Skip to content

Commit

Permalink
Merge pull request #1106 from quarkusio/update-outdated-html-templates
Browse files Browse the repository at this point in the history
Update outdated html templates to address #1104
  • Loading branch information
ynojima authored Jan 23, 2024
2 parents 244e9eb + 490cb4e commit 29a9a82
Show file tree
Hide file tree
Showing 2 changed files with 197 additions and 120 deletions.
259 changes: 146 additions & 113 deletions l10n/override/ja_JP/_includes/index-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,128 +4,161 @@
{% assign categories = index.quarkus.categories %}
{% assign by_type = index.quarkus | map: "types" | first %}


<section class="full-width-version-bg flexfilterbar">
<div class="flexcontainer">
<div class="flexlabel">
<label>バージョン: </label>
</div>
<div class="pulldown version">
<select id="guidesindex-version-dropdown">
{% for version in site.data.versions.documentation %}
<option value="{{ version }}" {% if docversion == version %}selected{% endif %}>{% if version == 'latest' %}{{ site.data.versions.quarkus.version | replace_regex: "\.[0-9+]\.Final", "" }} - {% endif %}{{ version | capitalize }}{% if version == 'main' %} - SNAPSHOT{% endif %}</option>
{% endfor %}
</select>
</div>
<div class="flexlabel">
<label>カテゴリー: </label>
</div>
<div class="pulldown category">
<select id="guidesindex-category-dropdown">
<option value="">全てのカテゴリー</option>
{% for item in categories %}
<option value="{{ item.cat-id }}">{{ item.category }}</option>
{% endfor %}
</select>
</div>
<div class="search">
<input type="text" id="search-text" placeholder="キーワードでフィルター" />
<div id="guides-app"
data-search-api-server="{{ site.search.url }}"
data-quarkus-version="{{ docversion }}"
data-language="{{ site.language }}"
data-initial-timeout="{{ site.search.initial-timeout }}"
data-more-timeout="{{ site.search.more-timeout }}"
data-min-chars="{{ site.search.min-chars }}">
<section class="full-width-version-bg flexfilterbar">
<div class="flexcontainer">
<div class="flexlabel">
<label>バージョン:</label>
</div>
<div class="pulldown version">
<select id="guidesindex-version-dropdown">
{% for version in site.data.versions.documentation %}
<option value="{{ version }}" {% if docversion == version %}selected{% endif %}>{% if version == 'latest' %}{{ site.data.versions.quarkus.version | replace_regex: "\.[0-9+]\.Final", "" }} - {% endif %}{{ version | capitalize }}{% if version == 'main' %} - SNAPSHOT{% endif %}</option>
{% endfor %}
</select>
</div>
<div class="flexlabel">
<label>カテゴリー:</label>
</div>
<div class="pulldown category">
<select v-model="category">
<option value="">全てのカテゴリー</option>
{% for item in categories %}
<option value="{{ item.cat-id }}">{{ item.category }}</option>
{% endfor %}
</select>
</div>
<div class="search">
<input v-model="text" type="text" placeholder="Filter by keyword" />
</div>
</div>
</div>
</section>

</section>


<div>
<h1 class="title">{{ page.title }}</h1>
</div>
<div class="grid-wrapper guides" id="docs">
{% include index-docs-merge.html type="tutorial" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3 id="tutorial">チュートリアル</h3>
<p>すぐ使い始めるための短く、焦点を絞ったエクササイズ。</p>
</div>
<div class="grid-wrapper">
{% for guide in values %}
{% include index-doc-item.html class="tutorialbkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
</div>
<div>
<h1 class="title">{{ page.title }}</h1>
</div>
{% endif %}
{% include index-docs-merge.html type="howto" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3 id="guide">ハウツーガイド</h3>
<p>主要なタスク、実際の操作、一般的な問題をカバーするためのステップバイステップガイド。</p>
</div>
<div class="grid-wrapper">
{% for guide in values %}
{% include index-doc-item.html class="guidebkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
<div v-if="hasInput" class="grid-wrapper guides results vuejs"
:class="{ empty: !loading && !hasHits, 'vuejs-enabled': true, loading: loading }">
<div class="grid__item width-12-12 docslist">
<Transition name="fade-in">
<div v-if="!loading && !hasHits" class="empty-placeholder">
検索に一致するガイドはございませんでした。別のキーワードでお試しください。
</div>
</Transition>
<div class="grid-wrapper">
{% raw %}
<div v-for="hit in searchHits" :class="`${hit.type}bkg grid__item docs-card`">
<h4><a :href="hit.url" :target="hit.url.startsWith('http') ? '_blank' : ''" v-html="hit.title"></a></h4>
<div class="description" v-html="hit.summary"></div>
<div class="content-highlights">
<p v-for="contentLine in hit.content" v-html="contentLine"></p>
</div>
</div>
{% endraw %}
<Transition name="fade-in">
<div v-if="loading" class="loading-placeholder">
ロード中...
</div>
</Transition>
</div>
</div>
</div>
{% endif %}
{% include index-docs-merge.html type="concepts" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3 id="concept">コンセプト</h3>
<p>Quarkus に関連するいくつかのより大きな概念とテクノロジーの解説。</p>
</div>
<div class="grid-wrapper">
{% for guide in values %}
{% include index-doc-item.html class="conceptbkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
<!-- Static content displayed when there is no input in the search form or Javascript is disabled,
but also used as a source of data for cards displayed by the vue.js app. -->
<div v-else class="grid-wrapper guides" id="all-docs">
{% include index-docs-merge.html type="tutorial" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3 id="tutorial">チュートリアル</h3>
<p>すぐ使い始めるための短く、焦点を絞ったエクササイズ。</p>
</div>
<div class="grid-wrapper">
{% for guide in values %}
{% include index-doc-item.html class="tutorialbkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% include index-docs-merge.html type="reference" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3 id="reference">リファレンス</h3>
<p>ツール、コンポーネント、およびコマンドをカバーするテクニカルリソース。 Quarkus の百科事典。</p>
{% endif %}
{% include index-docs-merge.html type="howto" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3 id="guide">ハウツーガイド</h3>
<p>主要なタスク、実際の操作、一般的な問題をカバーするためのステップバイステップガイド。</p>
</div>
<div class="grid-wrapper">
{% for guide in values %}
{% include index-doc-item.html class="howtobkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
</div>
</div>
<div class="grid-wrapper">
<div class="grid__item docs-card pdfbkg">
<h4><a href="https://lordofthejars.github.io/quarkus-cheat-sheet/" target="_blank">Quarkus Cheat Sheet</a></h4>
<div class="description">全チートシートをPDFでダウンロード <a href="https://developers.redhat.com/search?t=quarkus&f=type%7Echeatsheet" target="_blank">
Red Hat Developersウェブサイトで更にチートシートを入手 <i class="fas fa-external-link-alt"></i></a></div>
<div class="keywords"></div>
<div class="categories"></div>
</div>
{% for guide in values %}
{% include index-doc-item.html class="referencebkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
{% endif %}
{% include index-docs-merge.html type="concepts" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3 id="concept">コンセプト</h3>
<p>>Quarkus に関連するいくつかのより大きな概念とテクノロジーの解説。</p>
</div>
<div class="grid-wrapper">
{% for guide in values %}
{% include index-doc-item.html class="conceptsbkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% include index-docs-merge.html type="guide" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3 id="reference">その他のガイド</h3>
<p>その他のQuarkusガイド</p>
{% endif %}
{% include index-docs-merge.html type="reference" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3 id="reference">リファレンス</h3>
<p>ツール、コンポーネント、およびコマンドをカバーするテクニカルリソース。 Quarkus の百科事典。</p>
</div>
<div class="grid-wrapper">
<div class="grid__item docs-card pdfbkg">
<h4><a href="https://lordofthejars.github.io/quarkus-cheat-sheet/" target="_blank">Quarkus Cheat Sheet</a></h4>
<div class="description">全チートシートをPDFでダウンロード<a href="https://developers.redhat.com/search?t=quarkus&f=type%7Echeat_sheet" target="_blank">
Red Hat Developersウェブサイトで更にチートシートを入手 <i class="fas fa-external-link-alt"></i></a></div>
<div class="keywords"></div>
<div class="categories"></div>
</div>
{% for guide in values %}
{% include index-doc-item.html class="referencebkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
</div>
</div>
<div class="grid-wrapper">
{% for guide in values %}
{% include index-doc-item.html class="referencebkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
{% endif %}
{% include index-docs-merge.html type="guide" %}
{% if values %}
<div class="grid__item width-12-12 docslist">
<div class="doclist-header">
<h3>その他のガイド</h3>
<p>その他のQuarkusガイド</p>
</div>
<div class="grid-wrapper">
{% for guide in values %}
{% include index-doc-item.html class="guidebkg" docversion=docversion
title=guide.title url=guide.url summary=guide.summary
keywords=guide.keywords categories=guide.categories origin=guide.origin %}
{% endfor %}
</div>
</div>
{% endif %}
</div>
{% endif %}
<div class="grid__item width-12-12 empty-list">Sorry, no guides matched your search. Please try again.</div>
</div>
<script src="/assets/javascript/guides-app.js" type="module"></script>
58 changes: 51 additions & 7 deletions l10n/override/ja_JP/_layouts/guides.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
{% else %}
{% assign docversion = 'latest' %}
{% endif %}
{% assign docversion_index = docversion | replace: '.', '-' %}
{% assign relations = site.data.versioned[docversion_index].index.relations %}
{% assign guide_url = page.url | replace_regex: '^/version/[^/]+(/.*)', '\1' %}


<section class="full-width-version-bg flexfilterbar guides">
<div class="guideflexcontainer">
<div class="docslink">
Expand Down Expand Up @@ -47,12 +48,55 @@
</div>
</section>

<div class="grid-wrapper guide">
<div class="grid__item width-8-12 width-12-12-m">
<h1 class="text-caps">{{page.title}} {{page.docversion}}</h1>
{{ content }}
<div class="guide">
<div class="grid-wrapper">
<div class="grid__item width-8-12 width-12-12-m">
<h1 class="text-caps">{{page.title}} {{page.docversion}}</h1>
{{ content }}
</div>
<div class="grid__item width-4-12 width-12-12-m tocwrapper">
<div class="hide-mobile toc">{{ page.document | tocify_asciidoc: 2 }}</div>
</div>
</div>
<div class="grid__item width-4-12 width-12-12-m tocwrapper">
<div class="hide-mobile toc">{{ page.document | tocify_asciidoc: 2 }}</div>
{% if relations and relations[guide_url] -%}
<h2>関連コンテンツ</h2>
<div class="grid-wrapper relations">
{% if relations[guide_url].sameExtensions -%}
<div class="grid__item width-6-12 width-12-12-m">
<h3>同一エクステンション</h3>
<ul class="related-content">
{% for guide in relations[guide_url].sameExtensions -%}
{% assign is_external_guide = guide.url | startswith: 'http' %}
{% if is_external_guide %}
{% assign related_guide_url = include.url %}
{% elsif docversion == 'latest' %}
{% assign related_guide_url = site.baseurl | append: guide.url %}
{% else %}
{% assign related_guide_url = site.baseurl | append: '/version/' | append: docversion | append: guide.url %}
{% endif %}
<li class="{{ guide.type }}"><a href="{{ related_guide_url }}">{{ guide.title }}</a></li>
{% endfor -%}
</ul>
</div>
{% endif -%}
{% if relations[guide_url].sameTopics -%}
<div class="grid__item width-6-12 width-12-12-m">
<h3>同一トピック</h3>
<ul class="related-content">
{% for guide in relations[guide_url].sameTopics limit:20 -%}
{% assign is_external_guide = guide.url | startswith: 'http' %}
{% if is_external_guide %}
{% assign related_guide_url = include.url %}
{% elsif docversion == 'latest' %}
{% assign related_guide_url = site.baseurl | append: guide.url %}
{% else %}
{% assign related_guide_url = site.baseurl | append: '/version/' | append: docversion | append: guide.url %}
{% endif %}
<li class="{{ guide.type }}"><a href="{{ related_guide_url }}">{{ guide.title }}</a></li>
{% endfor -%}
</ul>
</div>
{% endif -%}
</div>
{% endif -%}
</div>

0 comments on commit 29a9a82

Please sign in to comment.