Fix various style/template issues (#2103)

* Fix various style/template issues

- Add styles to allow fully invisible headers. These can be used to
  support anchor links in translated pages, so we can move the link_subs
  out of the dactyl-config.yml. Example in transaction-common-fields.md
- Upgrade jQuery to 3.7.1
- Add left nav to references landings for consistent navigation
- Add breadcrumbs template (previously used Dactyl built-in) which
  throws an error if you specify a parent: that doesn't exist.
  (Previously it would write a blank link; the link checker would
  report this as an error, but it wasn't obvious what the cause was.)
- Fix #2014 (special case for code blocks nested in lists).
- Fix #2096.
- Remove excessive spacing between top nav and main content, and
  re-align top of main contents in all 3 columns for docs pages.
- Reorganize _content.scss to be easier to read.

* Upgrade yarn packages (fix dependabot alerts) & rebuild CSS

* Fix NFT broken link in translation

* [ja] Properly fix NFT data link
This commit is contained in:
Rome Reginelli
2023-09-06 13:15:19 -07:00
committed by GitHub
parent 007381291b
commit 66b6f951fe
23 changed files with 493 additions and 429 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
assets/vendor/jquery-3.7.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -108,6 +108,7 @@ URIフィールドは、`NFToken`に関連するデータまたはメタデー
**注意:** URIは変更不可能であるため、例えば、存在しないウェブサイトにリンクしていたとしても、誰もそれを更新することはできません。
# NFTokenデータとメタデータの取得
# Retrieving NFToken Data and Metadata {.invisible}
機能を犠牲にしたり不必要な制限を課したりすることなく`NFTokens`の容量を最小にするために、XRPL NFTは任意のデータフィールドを持ちません。その代わり、データは別に管理され、`NFToken`によって参照されます。URIは`Hash`に対して不変のコンテンツへの参照を提供し、`NFToken`オブジェクトに対しては任意の変更可能なデータを提供します。

View File

@@ -43,6 +43,7 @@ AccountTxnIDを使用するには、アカウントの1つ前のトランザク
## 自動入力可能なフィールド
## Auto-fillable Fields {.invisible}
一部のフィールドについては、トランザクションの署名前に、`rippled`サーバーによって、または署名に使用される[ripple-lib][]などのライブラリーによって値を自動入力できます。値を自動入力するには、最新の状態を取得するためのXRP Ledgerへのアクティブな接続が必要です。したがって、オフラインでは実行できません。[ripple-lib][]と`rippled`のどちらも、以下の値を自動的に提供できます。

View File

@@ -119,8 +119,6 @@ targets:
"use-payment-channels.html#8-when-ready-the-payee-redeems-a-claim-for-the-authorized-amount": "use-payment-channels.html#8-準備が完了すれば受取人は承認された額のクレームを清算します"
"use-payment-channels.html#9-when-the-payer-and-payee-are-done-doing-business-the-payer-requests-for-the-channel-to-be-closed": "use-payment-channels.html#9-支払人と受取人の取引完了後支払人はchannelの閉鎖を要求します"
"reserves.html#owner-reserves": "reserves.html#所有者準備金"
# Fix links from untranslated issue-a-fungible-token.html:
"transaction-common-fields.html#auto-fillable-fields": "transaction-common-fields.html#自動入力可能なフィールド"
# Fix links from untranslated validator-list.html
"run-rippled-as-a-validator.html#3-enable-validation-on-your-rippled-server": "run-rippled-as-a-validator.html#3-rippledサーバーで検証を有効化"
"basic-data-types.html#specifying-time": "basic-data-types.html#時間の指定"
@@ -207,7 +205,6 @@ targets:
"nftoken.html#transferfee": "nftoken.html#送金手数料"
"nftoken-batch-minting.html#mint-on-demand-lazy-minting": "nftoken-batch-minting.html#オンデマンドmint-遅延minting"
"nftoken-batch-minting.html#scripted-minting": "nftoken-batch-minting.html#スクリプトminting"
"nftoken.html#retrieving-nftoken-data-and-metadata": "nftoken.html#nftoken-データとメタデータの取得"
# Fix link from untranslated Clio ledger method page:
"transactions.html#authorizing-transactions": "transactions.html#トランザクションの承認"
# Fix link from untranslated addresses.html:
@@ -2154,7 +2151,7 @@ pages:
html: references.html
parent: docs.html
top_nav_grouping: Article Types
sidebar: disabled
sidebar: left_only
blurb: Complete references for different interfaces to the XRP Ledger.
targets:
- en
@@ -2165,7 +2162,7 @@ pages:
html: references.html
parent: docs.html
top_nav_grouping: Article Types
sidebar: disabled
sidebar: left_only
blurb: XRP Ledgerへのさまざまなインターフェイスの包括的なリファレンスです。
targets:
- ja

View File

@@ -3,7 +3,7 @@
.breadcrumbs-wrap {
position: relative;
z-index: 11;
padding: 0 2rem 2rem 2rem;
padding: 0 0 2rem 0;
}
.interactive-block .breadcrumbs-wrap {

View File

@@ -1,85 +1,109 @@
/* Content text styling (applies mostly to Markdown-generated content)------- */
// TODO: convert this to nested SCSS format
.content {
padding-bottom: 50px;
p code,
table code,
ul code,
ol code {
li > code {
background-color: $green-1000;
color: $green-400;
}
a {
text-decoration: underline;
}
h1 {
font-size: 3rem;
margin-top: 32px;
line-height: 1.2;
font-weight: 700;
&:first-child {
margin-top: 0;
line-height: 1.2;
&::before {
margin-top: -80px;
}
}
}
h2 {
margin-top: 2.5rem;
margin-bottom: 1.5rem;
font-size: 2.5rem;
font-weight: 600;
line-height: 1.2;
}
h3 {
font-size: 2.125rem;
margin-top: 2rem;
margin-bottom: 1rem;
line-height: 1.2;
}
h4 {
font-size: 1.75rem;
margin-top: 1.5rem;
margin-bottom: 0.5rem;
line-height: 1.2;
}
h5 {
font-size: 1.25rem;
margin-top: 1.25rem;
line-height: 1.2;
font-weight: 700;
}
h6 {
font-size: 1rem;
margin-top: 1rem;
line-height: 1.2;
font-weight: 700;
}
/* Some list items contain <p> tags, some don't. These styles make sure both
kinds are spaced consistently. */
li {
margin: 6px;
margin-top: 24px;
}
li p {
margin: 0;
}
// "Source" links float right
a[title="Source"] {
float: right;
padding-left: 20px;
}
// Make "invisible" headers take up no space either, so we can use them
// to add additional anchors (e.g. for translated pages)
h1.invisible,
h2.invisible,
h3.invisible,
h4.invisible,
h5.invisible,
h6.invisible {
font-size: 0;
line-height: 0;
margin: 0;
.hover_anchor {
display: none;
}
}
}
.content a,
.blurb a {
text-decoration: underline;
}
.content h1 {
font-size: 3rem;
margin-top: 32px;
line-height: 1.2;
font-weight: 700;
}
.content h1:first-child,
.landing section:first-of-type h1:first-child {
margin-top: 0;
line-height: 1.2;
}
.content h1:first-child:before {
margin-top: -80px;
}
.content h2 {
margin-top: 2.5rem;
margin-bottom: 1.5rem;
font-size: 2.5rem;
font-weight: 600;
line-height: 1.2;
}
.content h3 {
font-size: 2.125rem;
margin-top: 2rem;
margin-bottom: 1rem;
line-height: 1.2;
}
.content h4 {
font-size: 1.75rem;
margin-top: 1.5rem;
margin-bottom: 0.5rem;
line-height: 1.2;
}
.content h5 {
font-size: 1.25rem;
margin-top: 1.25rem;
line-height: 1.2;
font-weight: 700;
}
.content h6 {
font-size: 1rem;
margin-top: 1rem;
line-height: 1.2;
font-weight: 700;
}
/* Some list items contain <p> tags, some don't. These styles make sure both
kinds are spaced consistently. */
.content li {
margin: 6px;
margin-top: 24px;
}
.content li p {
margin: 0;
}
/* "Source" links float right */
.content a[title="Source"] {
float: right;
padding-left: 20px;
}
// Hover anchors ---------------
.hover_anchor {
visibility: hidden;

View File

@@ -146,7 +146,11 @@
}
.langs {
&> a {
display: block;
}
h5:hover {
text-decoration: underline;
text-decoration-color: $purple;
@@ -166,6 +170,11 @@
h5 {
margin-block-start: 0 !important;
&::before {
margin-top: 0;
height: 0;
}
}
}
@@ -182,7 +191,7 @@
text-decoration: none !important;
background: none !important;
}
}
}
@media (max-width: 765px) {
.page-docs-index {
@@ -192,7 +201,7 @@
.flat-card-grid {
grid-gap: 24px;
.flat-card {
padding: 32px 12px;
}
@@ -218,7 +227,7 @@
}
.dev-tools-img {
max-width:100%;
max-width:100%;
max-height: 100%;
margin:auto;
}
@@ -277,7 +286,7 @@
text-decoration: underline;
text-decoration-color: $purple;
}
&::after {
content: none !important;
}
@@ -291,7 +300,7 @@
.nav-link::after {
content: ' ' !important;
}
.flat-card .btn {
display: none;
}

View File

@@ -23,6 +23,11 @@
}
}
section:first-of-type h1:first-child {
margin-top: 0;
line-height: 1.2;
}
.level-1,
.level-2{
margin-top: 0;

View File

@@ -17,10 +17,6 @@ section {
padding: 0;
}
#main_content_wrapper { // Push below fixed nav
margin-top: 80px;
}
// Square blocks ---------------------------------------------------------------
.square {

View File

@@ -314,7 +314,7 @@ html.light .token-banner-container {
}
}
$banner-top-offset: 146px;
$banner-top-offset: 108px;
.floating-nav {
top: $banner-top-offset;
@@ -336,10 +336,6 @@ $banner-top-offset: 146px;
margin-top: -$banner-top-offset;
}
#main_content_wrapper {
margin-top: 53px;
}
html.light {
.top-banner {
.btn-outline-secondary {

View File

@@ -565,7 +565,6 @@
.main h4:before,
.main h5:before,
.main h6:before,
#main_content_wrapper:before,
.interactive-block:before {
display: block;
content: " ";

View File

@@ -2,8 +2,7 @@
.content {
p code,
table code,
ul code,
ol code {
li > code {
background-color: $gray-200;
color: $gray-900;
}
@@ -134,10 +133,10 @@ h6,
color: var(--docsearch-text-color) !important;
}
.DocSearch-Input{
color: $gray-900;
color: $gray-900;
}
.DocSearch-Hit-Select-Icon{
color: $gray-900;
color: $gray-900;
}
.DocSearch-Form {
box-shadow: inset 0 0 0 2px $blue-purple-500;
@@ -166,7 +165,7 @@ h6,
}
.DocSearch-Logo svg{
.cls-1, .cls-2{
fill:var(--docsearch-logo-color);;
fill:var(--docsearch-logo-color);;
}
}
.DocSearch-Hit-title,
@@ -733,7 +732,7 @@ pre code {
'ripples-on-demand-liquidity': 'svg',
'xumm-wallet': 'svg',
'sologenic-dex': 'svg'
)
)
{
#use_case_companies_list {
##{$company} {
@@ -741,7 +740,7 @@ pre code {
max-height: 40px;
content: url("../img/uses/lightmode/#{$company}.#{$type}");
}
}
}
}
}
@@ -750,13 +749,13 @@ pre code {
// #coil,
#forte,
#xrplorer,
#gatehub
#gatehub
{
.biz-logo {
filter: invert(100%);
}
}
}
.landing-bg {

View File

@@ -4,9 +4,9 @@
"node-sass": "^7.0.0"
},
"scripts": {
"build-css": "node-sass --include-path scss xrpl.scss ../assets/css/devportal2022-v23.css --output-style compressed",
"build-css-out": "node-sass --include-path scss xrpl.scss ../out/assets/css/devportal2022-v23.css --output-style compressed --source-map true",
"build-css-watch-out": "node-sass --recursive --watch --include-path scss xrpl.scss ../out/assets/css/devportal2022-v23.css --output-style compressed --source-map true"
"build-css": "node-sass --include-path scss xrpl.scss ../assets/css/devportal2022-v24.css --output-style compressed",
"build-css-out": "node-sass --include-path scss xrpl.scss ../out/assets/css/devportal2022-v24.css --output-style compressed --source-map true",
"build-css-watch-out": "node-sass --recursive --watch --include-path scss xrpl.scss ../out/assets/css/devportal2022-v24.css --output-style compressed --source-map true"
},
"dependencies": {
"sass": "^1.26.10"

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,7 @@
{% endif %}
<!-- jQuery -->
<script src="{{currentpage.prefix}}assets/vendor/jquery-3.6.0.min.js"></script>
<script src="{{currentpage.prefix}}assets/vendor/jquery-3.7.1.min.js"></script>
<!-- Google Tag Manager -->
{% block analytics %}{% endblock %}
@@ -46,13 +46,13 @@
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KCQZ3L8');</script>
<!-- Stylesheet -->
{% if target.lang=="ja" %}
<link href="{{currentpage.prefix}}assets/css/fonts-ja.css" rel="stylesheet" />
{% endif %}
<link href="{{currentpage.prefix}}assets/css/devportal2022-v23.css" rel="stylesheet" />
<link href="{{currentpage.prefix}}assets/css/devportal2022-v24.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
@@ -96,7 +96,7 @@
<!-- main column -->
<main class="main {% if currentpage.sidebar is defined and currentpage.sidebar == "disabled" %}col-md-12{% elif currentpage.sidebar == "left_only" %}col-lg-9 col-md-7{% else %}col-md-7 col-lg-6{% endif %} order-md-3 {% block mainclasses %}{% endblock %}" role="main" id="main_content_body">
{% block breadcrumbs %}
{% include 'breadcrumbs.html' %}
{% include 'component-breadcrumbs.html.jinja' %}
{% endblock %}
{% block main %}{% endblock %}
</main>

View File

@@ -0,0 +1,29 @@
<nav class="breadcrumbs-wrap" aria-label="breadcrumb">
<ul class="breadcrumb">
{% set ns=namespace(crumbs = []) -%}
{%- macro get_crumbs(page) %}
{% if page.parent is undefined or page.parent == "index.html" %}
{% set homepage = pages|selectattr('html', 'defined_and_equalto', 'index.html')|list|first %}
{% set _ = ns.crumbs.insert(0, homepage) %}
{% else %}
{% set parent = pages|selectattr('html', 'defined_and_equalto', page.parent)|list|first %}
{% if parent is undefined %}
{% include "ERROR: Page "+page.html+" specifies a parent that doesn't exist in this target: "+page.parent %}
{% else %}
{% set _ = ns.crumbs.insert(0, parent) -%}
{{ get_crumbs(parent) }}
{% endif %}
{%- endif -%}
{%- endmacro %}
{{ get_crumbs(currentpage) }}
{% if currentpage.html != "index.html" %}
{%- for page in ns.crumbs %}
<li class="active breadcrumb-item"><a href="
{%- if page is defined and "//" not in page.html %}{{ currentpage.prefix }}{% endif -%}
{{ page.html }}">{{ page.name }}</a></li>
{% endfor %}
{% endif %}
<li class="active breadcrumb-item">{{ currentpage.name }}</li>
</ul>
</nav><!--/.breadcrumbs-wrap-->

View File

@@ -4,7 +4,7 @@
{% block main %}
<section class="py-20 text-center">
<div class="col-xl-4 col-lg-6 mx-auto text-center">
<div class="col-xl-8 col-lg-10 mx-auto text-center">
<div class="d-flex flex-column-reverse">
<h1 class="mb-18">{% trans %}References and APIs{% endtrans %}</h1>
<h6 class="eyebrow mb-3">{% trans %}Everything You Need to Know{% endtrans %}</h6>
@@ -92,10 +92,9 @@
<p class="card-text">{{page.blurb}}</p>
</div>
<div class="card-footer">&nbsp;</div>
</a>
</a><!--/.card-->
{% endif %}
{% endfor %}
</div>
{% endfor %}
</div><!--/.card-deck-->
</section>

View File

@@ -5,7 +5,7 @@
{% block main %}
{% if content %}
<section class="pt-3 p-md-3">
<section class="p-0">
<article class="content">
{{ content }}
@@ -16,7 +16,7 @@
</section>
{% else %}
<section class="pt-3 p-md-3">
<section class="p-0">
<article class="content">
<h1 id="main-page-header">{{ currentpage.name }}</h1>
{% if currentpage.blurb != target.blurb %}<p class="blurb">{{ currentpage.blurb }}</p>{% endif %}

View File

@@ -19,7 +19,7 @@
{% endblock %}
{% block main %}
<article class="pt-3 p-md-3">
<article>
{% if (target.lang != "en" and "en" in currentpage.targets) or currentpage.untranslated_warning %}
{# Add a "sorry this page isn't translated" banner. #}
<div class="mb-5 devportal-callout note"><strong>{% trans %}Sorry, this page is not available in your language.{% endtrans %}</strong>

View File

@@ -11,7 +11,7 @@
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<script src="{{currentpage.prefix}}assets/vendor/jquery-3.6.0.min.js"></script>
<script src="{{currentpage.prefix}}assets/vendor/jquery-3.7.1.min.js"></script>
<link href="{{currentpage.prefix}}assets/css/devportal2021.css" rel="stylesheet" />
{% block head %}