From 17076a30846b797852ca5ed9d6ee299ffd80d08f Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Sat, 4 Jan 2020 19:09:35 +0000 Subject: [PATCH] Move new post form into modal dialog With a button in the page actions menu for opening the modal dialog. This means that "footer links" are no longer needed, now there's only header links. (The footer links weren't working anymore anyway, since I removed the footer.) --- _data/footer_links.yaml | 3 -- _includes/edit_page_link.html | 4 +- _includes/new_post_form.html | 2 +- _includes/new_post_link.html | 1 + _includes/new_post_modal.html | 42 +++++++++++++++++++ _includes/page_actions_menu.html | 17 ++++---- _includes/view_source_link.html | 4 +- _layouts/default.html | 1 + ...11-11-edit-page-and-view-source-buttons.md | 19 +++++++-- _posts/2019-11-11-new-post-form.md | 35 ++++++---------- _posts/2019-11-25-header-and-footer-links.md | 17 -------- _posts/2019-11-25-header-links.md | 8 ++++ _sass/_modal.scss | 30 +++++++++++++ _sass/jekyll-theme-seanh.scss | 1 + new.md | 4 -- 15 files changed, 123 insertions(+), 65 deletions(-) delete mode 100644 _data/footer_links.yaml create mode 100644 _includes/new_post_link.html create mode 100644 _includes/new_post_modal.html delete mode 100644 _posts/2019-11-25-header-and-footer-links.md create mode 100644 _posts/2019-11-25-header-links.md create mode 100644 _sass/_modal.scss delete mode 100644 new.md diff --git a/_data/footer_links.yaml b/_data/footer_links.yaml deleted file mode 100644 index a120275..0000000 --- a/_data/footer_links.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- url: new - text: New - title: Create a new post diff --git a/_includes/edit_page_link.html b/_includes/edit_page_link.html index b8b3cbd..662423f 100644 --- a/_includes/edit_page_link.html +++ b/_includes/edit_page_link.html @@ -1,3 +1 @@ -{% if site.edit_page_link != false %} - Edit -{% endif %} +Edit diff --git a/_includes/new_post_form.html b/_includes/new_post_form.html index caac81f..f52051c 100644 --- a/_includes/new_post_form.html +++ b/_includes/new_post_form.html @@ -9,7 +9,7 @@ Type a title and hit Enter to create a new post in {{ site.github.hostname }}/{{ site.github.repository_nwo }}: - + diff --git a/_includes/page_actions_menu.html b/_includes/page_actions_menu.html index 0a789ba..97b6b75 100644 --- a/_includes/page_actions_menu.html +++ b/_includes/page_actions_menu.html @@ -7,13 +7,14 @@ {% include page_actions_menu.html %} {% endcomment %} {% capture menu_items %} - {% for item in site.data.footer_links %} - {{ item.text }} - {% endfor %} - {% include view_source_link.html %} - {% include edit_page_link.html %} + {% if site.new_post_link != false %}{% include new_post_link.html %}{% endif %} + {% if site.view_source_link != false %}{% include view_source_link.html %}{% endif %} + {% if site.edit_page_link != false %}{% include edit_page_link.html %}{% endif %} {% endcapture %} -
- {% include dropup.html menu_items=menu_items %} -
+{% assign menu_items = menu_items | strip %} +{% if menu_items != "" %} +
+ {% include dropup.html menu_items=menu_items %} +
+{% endif %} diff --git a/_includes/view_source_link.html b/_includes/view_source_link.html index 688313b..db8d9bd 100644 --- a/_includes/view_source_link.html +++ b/_includes/view_source_link.html @@ -1,3 +1 @@ -{% if site.view_source_link != false -%} - View Source -{%- endif %} +View Source diff --git a/_layouts/default.html b/_layouts/default.html index 2417ca9..e2ab5d3 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -38,6 +38,7 @@ {{ content }} {% include page_actions_menu.html %} + {% if site.new_post_link != false %}{% include new_post_modal.html %}{% endif %}