From 35c737fc1436470b5e62f9f5cd6bb1d6878dfc6c Mon Sep 17 00:00:00 2001 From: Yehonal Date: Wed, 24 Apr 2019 14:39:50 +0200 Subject: Implemented service config and fixed action buttons --- _includes/git-wiki/components/action_btn/page_actions.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to '_includes/git-wiki/components') diff --git a/_includes/git-wiki/components/action_btn/page_actions.html b/_includes/git-wiki/components/action_btn/page_actions.html index 03f1d85..097dc51 100644 --- a/_includes/git-wiki/components/action_btn/page_actions.html +++ b/_includes/git-wiki/components/action_btn/page_actions.html @@ -8,14 +8,18 @@ Add new Edit + {% if site.service == "gitlab" %} + Delete + {% else %} Delete + {% endif %} History Source {% if site.blog_feature %} Add new post {% endif %} - {% if site.use_prose_io %} + {% if site.use_prose_io and site.service == "github" %}
Prose.io: Add -- cgit From f98b158f36f7b6323bca657d539ed60cfd723a8d Mon Sep 17 00:00:00 2001 From: Takuma Ishikawa Date: Mon, 6 Jan 2020 17:39:55 +0900 Subject: Escape several strings, especially title (#71) Co-authored-by: Yehonal --- .../git-wiki/components/action_btn/page_actions.html | 20 ++++++++++---------- _includes/git-wiki/components/lists/page-list.html | 2 +- _includes/git-wiki/components/lists/post-list.html | 2 +- _includes/git-wiki/components/logo/logo.html | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to '_includes/git-wiki/components') diff --git a/_includes/git-wiki/components/action_btn/page_actions.html b/_includes/git-wiki/components/action_btn/page_actions.html index 097dc51..b9151b4 100644 --- a/_includes/git-wiki/components/action_btn/page_actions.html +++ b/_includes/git-wiki/components/action_btn/page_actions.html @@ -5,28 +5,28 @@ History Source {% else %} - Add + Add new - Edit + Edit {% if site.service == "gitlab" %} - Delete + Delete {% else %} - Delete + Delete {% endif %} - History - Source + History + Source {% if site.blog_feature %} - Add + Add new post {% endif %} {% if site.use_prose_io and site.service == "github" %}
Prose.io: - Add + Add new - Edit + Edit {% if site.blog_feature %} - Add + Add new post {% endif %} {% endif %} diff --git a/_includes/git-wiki/components/lists/page-list.html b/_includes/git-wiki/components/lists/page-list.html index dea6758..8129bf0 100644 --- a/_includes/git-wiki/components/lists/page-list.html +++ b/_includes/git-wiki/components/lists/page-list.html @@ -15,7 +15,7 @@ {% if page.is_wiki_page != false and page.sitemap != false %}
  • {% assign title = page.title | default: page.name %} - {{title}} + {{title | escape}}
  • {% assign numPages = numPages | plus: 1 %} {% endif %} diff --git a/_includes/git-wiki/components/lists/post-list.html b/_includes/git-wiki/components/lists/post-list.html index d6fa663..579dab5 100644 --- a/_includes/git-wiki/components/lists/post-list.html +++ b/_includes/git-wiki/components/lists/post-list.html @@ -15,7 +15,7 @@ {% if post.layout != "null" and post.sitemap != false and post.title %}
  • - {{ post.title}} + {{ post.title | escape }}
  • {% assign numPages = numPages | plus: 1 %} {% endif %} diff --git a/_includes/git-wiki/components/logo/logo.html b/_includes/git-wiki/components/logo/logo.html index d33305e..375b06b 100644 --- a/_includes/git-wiki/components/logo/logo.html +++ b/_includes/git-wiki/components/logo/logo.html @@ -1,6 +1,6 @@ \ No newline at end of file -- cgit From 7341eb7c340d8291b86268281db274e52cc3cf1b Mon Sep 17 00:00:00 2001 From: Yehonal Date: Tue, 7 Jan 2020 08:19:13 +0100 Subject: move searchdata under assets/js --- _includes/git-wiki/components/search/se_js.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '_includes/git-wiki/components') diff --git a/_includes/git-wiki/components/search/se_js.html b/_includes/git-wiki/components/search/se_js.html index 85e168c..87396be 100644 --- a/_includes/git-wiki/components/search/se_js.html +++ b/_includes/git-wiki/components/search/se_js.html @@ -4,4 +4,4 @@ - + -- cgit From b3079927197d733856f44409a80110a38cdfec33 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Wed, 8 Jan 2020 22:01:08 +0100 Subject: defining service automatically based on metadata hostname --- _includes/git-wiki/components/action_btn/page_actions.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '_includes/git-wiki/components') diff --git a/_includes/git-wiki/components/action_btn/page_actions.html b/_includes/git-wiki/components/action_btn/page_actions.html index b9151b4..78a4dac 100644 --- a/_includes/git-wiki/components/action_btn/page_actions.html +++ b/_includes/git-wiki/components/action_btn/page_actions.html @@ -8,7 +8,7 @@ Add new Edit - {% if site.service == "gitlab" %} + {% if site.hostname == "gitlab.com" %} Delete {% else %} Delete @@ -19,7 +19,7 @@ Add new post {% endif %} - {% if site.use_prose_io and site.service == "github" %} + {% if site.use_prose_io and site.hostname == "github.com" %}
    Prose.io: Add -- cgit From 29f1c0268fa610a934da837a404b90125a67aa18 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 11 Jan 2020 12:56:26 +0100 Subject: Update page_actions.html --- _includes/git-wiki/components/action_btn/page_actions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '_includes/git-wiki/components') diff --git a/_includes/git-wiki/components/action_btn/page_actions.html b/_includes/git-wiki/components/action_btn/page_actions.html index 78a4dac..9902234 100644 --- a/_includes/git-wiki/components/action_btn/page_actions.html +++ b/_includes/git-wiki/components/action_btn/page_actions.html @@ -19,7 +19,7 @@ Add new post {% endif %} - {% if site.use_prose_io and site.hostname == "github.com" %} + {% if site.use_prose_io and site.hostname != "gitlab.com" %}
    Prose.io: Add -- cgit From a81a933ab806dabbc6720d98f470c6a5edcd9a15 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 11 Jan 2020 23:45:58 +0100 Subject: implemented static TOC #57 Thanks to @vzickus for the suggestion --- _includes/git-wiki/components/toc/toc-lib.html | 96 ++++++++++++++++++++++++++ _includes/git-wiki/components/toc/toc.html | 12 ++++ 2 files changed, 108 insertions(+) create mode 100644 _includes/git-wiki/components/toc/toc-lib.html create mode 100644 _includes/git-wiki/components/toc/toc.html (limited to '_includes/git-wiki/components') diff --git a/_includes/git-wiki/components/toc/toc-lib.html b/_includes/git-wiki/components/toc/toc-lib.html new file mode 100644 index 0000000..4aa9c88 --- /dev/null +++ b/_includes/git-wiki/components/toc/toc-lib.html @@ -0,0 +1,96 @@ +{% capture tocWorkspace %} + {% comment %} + Version 1.0.9 + https://github.com/allejo/jekyll-toc + + "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe + + Usage: + {% include toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %} + + Parameters: + * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll + + Optional Parameters: + * sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC + * class (string) : '' - a CSS class assigned to the TOC + * id (string) : '' - an ID to assigned to the TOC + * h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored + * h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored + * ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list + * item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level + * baseurl (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content + * anchor_class (string) : '' - add custom class(es) for each anchor element + + Output: + An ordered or unordered list representing the table of contents of a markdown block. This snippet will only + generate the table of contents and will NOT output the markdown given to it + {% endcomment %} + + {% capture my_toc %}{% endcapture %} + {% assign orderedList = include.ordered | default: false %} + {% assign minHeader = include.h_min | default: 1 %} + {% assign maxHeader = include.h_max | default: 6 %} + {% assign nodes = include.html | split: ' maxHeader %} + {% continue %} + {% endif %} + + {% if firstHeader %} + {% assign firstHeader = false %} + {% assign minHeader = headerLevel %} + {% endif %} + + {% assign indentAmount = headerLevel | minus: minHeader %} + {% assign _workspace = node | split: '' | first }}>{% endcapture %} + {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %} + + {% assign space = '' %} + {% for i in (1..indentAmount) %} + {% assign space = space | prepend: ' ' %} + {% endfor %} + + {% if include.item_class and include.item_class != blank %} + {% capture listItemClass %}{:.{{ include.item_class | replace: '%level%', headerLevel }}}{% endcapture %} + {% endif %} + + {% capture heading_body %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %} + {% capture my_toc %}{{ my_toc }} +{{ space }}{{ listModifier }} {{ listItemClass }} [{{ heading_body | replace: "|", "\|" }}]({% if include.baseurl %}{{ include.baseurl }}{% endif %}#{{ html_id }}){% if include.anchor_class %}{:.{{ include.anchor_class }}}{% endif %}{% endcapture %} + {% endfor %} + + {% if include.class and include.item_class != blank %} + {% capture my_toc %}{:.{{ include.class }}} +{{ my_toc | lstrip }}{% endcapture %} + {% endif %} + + {% if include.id %} + {% capture my_toc %}{: #{{ include.id }}} +{{ my_toc | lstrip }}{% endcapture %} + {% endif %} +{% endcapture %}{% assign tocWorkspace = '' %}{{ my_toc | markdownify | strip }} \ No newline at end of file diff --git a/_includes/git-wiki/components/toc/toc.html b/_includes/git-wiki/components/toc/toc.html new file mode 100644 index 0000000..c354b42 --- /dev/null +++ b/_includes/git-wiki/components/toc/toc.html @@ -0,0 +1,12 @@ +{% if site.inc_before_toc %} +{% include {{ site.inc_before_toc }} %} +{% endif %} + +
    +

    Contents:

    + {% include git-wiki/components/toc/toc-lib.html html=content sanitize=true class="inline_toc" id="git-wiki-toc" h_min=1 h_max=3 ordered=1 %} +
    + +{% if site.inc_after_toc %} +{% include {{ site.inc_after_toc }} %} +{% endif %} -- cgit