mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
RTL support (#29)
This commit is contained in:
committed by
Luiz F. A. de Prá
parent
7207be04f0
commit
fe847fb152
24
Makefile
24
Makefile
@@ -1,15 +1,29 @@
|
|||||||
|
# LESS params
|
||||||
LESS_DIR = ./static/less
|
LESS_DIR = ./static/less
|
||||||
LESS_FILE = style.less
|
LESS_FILE = style.less
|
||||||
|
LESS_RTL_FILE = style-rtl.less
|
||||||
|
|
||||||
|
# CSS params
|
||||||
CSS_DIR = ./static/css
|
CSS_DIR = ./static/css
|
||||||
CSS_FILE = style.min.css
|
CSS_FILE = style.min.css
|
||||||
|
CSS_RTL_FILE = style-rtl.min.css
|
||||||
CSS_TMP_FILE = tmp.css
|
CSS_TMP_FILE = tmp.css
|
||||||
|
|
||||||
.PHONY: clean demo build
|
define build_less
|
||||||
|
lessc $(LESS_DIR)/$(1) > $(CSS_DIR)/$(CSS_TMP_FILE)
|
||||||
build: clean
|
uglifycss $(CSS_DIR)/$(CSS_TMP_FILE) > $(CSS_DIR)/$(2)
|
||||||
lessc $(LESS_DIR)/$(LESS_FILE) > $(CSS_DIR)/$(CSS_TMP_FILE)
|
|
||||||
uglifycss $(CSS_DIR)/$(CSS_TMP_FILE) > $(CSS_DIR)/$(CSS_FILE)
|
|
||||||
rm -f $(CSS_DIR)/$(CSS_TMP_FILE)
|
rm -f $(CSS_DIR)/$(CSS_TMP_FILE)
|
||||||
|
endef
|
||||||
|
|
||||||
|
.PHONY: clean demo build build-ltr build-rtl
|
||||||
|
|
||||||
|
build: clean build-ltr build-rtl
|
||||||
|
|
||||||
|
build-ltr:
|
||||||
|
$(call build_less,$(LESS_FILE),$(CSS_FILE))
|
||||||
|
|
||||||
|
build-rtl:
|
||||||
|
$(call build_less,$(LESS_RTL_FILE),$(CSS_RTL_FILE))
|
||||||
|
|
||||||
demo: build
|
demo: build
|
||||||
mkdir -p demo/themes/coder
|
mkdir -p demo/themes/coder
|
||||||
|
|||||||
@@ -46,7 +46,10 @@ pygmentscodefencesguesssyntax = true # Enable syntax guessing for code fences wi
|
|||||||
hideCopyright = false
|
hideCopyright = false
|
||||||
|
|
||||||
# Custom CSS
|
# Custom CSS
|
||||||
custom_css = []
|
custom_css = []
|
||||||
|
|
||||||
|
# RTL support
|
||||||
|
rtl = false
|
||||||
|
|
||||||
# Social links
|
# Social links
|
||||||
[[params.social]]
|
[[params.social]]
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ disqusShortname = "yourdiscussshortname"
|
|||||||
hideCopyright = false
|
hideCopyright = false
|
||||||
|
|
||||||
# Custom CSS
|
# Custom CSS
|
||||||
custom_css = []
|
custom_css = []
|
||||||
|
|
||||||
|
# RTL support
|
||||||
|
rtl = false
|
||||||
|
|
||||||
[[params.social]]
|
[[params.social]]
|
||||||
name = "Github"
|
name = "Github"
|
||||||
|
|||||||
@@ -18,6 +18,10 @@
|
|||||||
<link rel="stylesheet" href="//cdn.rawgit.com/necolas/normalize.css/master/normalize.css">
|
<link rel="stylesheet" href="//cdn.rawgit.com/necolas/normalize.css/master/normalize.css">
|
||||||
<link rel="stylesheet" href="{{ "css/style.min.css" | absURL }}">
|
<link rel="stylesheet" href="{{ "css/style.min.css" | absURL }}">
|
||||||
|
|
||||||
|
{{ if .Site.Params.rtl}}
|
||||||
|
<link rel="stylesheet" href="{{ "css/style-rtl.min.css" | absURL }}">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ range .Site.Params.custom_css }}
|
{{ range .Site.Params.custom_css }}
|
||||||
<link rel="stylesheet" href="{{ . | absURL }}">
|
<link rel="stylesheet" href="{{ . | absURL }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -33,7 +37,7 @@
|
|||||||
{{ .Hugo.Generator }}
|
{{ .Hugo.Generator }}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body class="{{ if .Site.Params.rtl }}rtl{{ end }}">
|
||||||
<main class="wrapper">
|
<main class="wrapper">
|
||||||
{{ partial "header.html" . }}
|
{{ partial "header.html" . }}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
{{ .Site.Title }}
|
{{ .Site.Title }}
|
||||||
</a>
|
</a>
|
||||||
{{ with .Site.Menus.main }}
|
{{ with .Site.Menus.main }}
|
||||||
<ul class="navigation-list float-right">
|
<ul class="navigation-list {{ if $.Site.Params.rtl }} float-left {{ else }} float-right {{ end }}">
|
||||||
{{ range sort . }}
|
{{ range sort . }}
|
||||||
<li class="navigation-item">
|
<li class="navigation-item">
|
||||||
<a class="navigation-link" href="{{ .URL }}">{{ .Name }}</a>
|
<a class="navigation-link" href="{{ .URL }}">{{ .Name }}</a>
|
||||||
|
|||||||
1
static/css/style-rtl.min.css
vendored
Normal file
1
static/css/style-rtl.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
body.rtl{direction:rtl}body.rtl blockquote{border-right:2px solid #dcdcdc;padding-right:1.6rem}body.rtl table tr td:first-child,body.rtl table tr th:first-child{border-right:0}body.rtl table tr td:last-child,body.rtl table tr th:last-child{border-left:0}body.rtl .navigation ul li{float:right}body.rtl .list ul li span{text-align:left;margin-left:3rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){body.rtl .list ul li span{text-align:right}}
|
||||||
2
static/css/style.min.css
vendored
2
static/css/style.min.css
vendored
@@ -1 +1 @@
|
|||||||
*,*:after,*:before{box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{display:flex;color:#323232;background-color:#fefefe;font-family:'Fira Mono',monospace;font-size:1.6em;font-weight:400;letter-spacing:.0625em;line-height:1.8em}@media only screen and (min-device-width:320px) and (max-device-width:480px){body{font-size:1.4em;line-height:1.6em}}a{font-weight:700;color:#000;text-decoration:none}a:focus,a:hover{text-decoration:underline}p{margin:1.6rem 0 1.6rem 0}p a{font-weight:400;color:#000;text-decoration:underline;text-underline-position:under}p a:focus,p a:hover{color:#36c}h1,h2,h3,h4,h5,h6{color:#000;text-transform:uppercase;letter-spacing:.0625em;margin:3.2rem 0 1.6rem 0}h1{font-size:3.2rem;line-height:3.2rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h1{font-size:2.8rem;line-height:2.8rem}}h2{font-size:2.8rem;line-height:2.8rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h2{font-size:2.4rem;line-height:2.4rem}}h3{font-size:2.4rem;line-height:2.4rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h3{font-size:2rem;line-height:2rem}}h4{font-size:2.2rem;line-height:2.2rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h4{font-size:1.8rem;line-height:1.8rem}}h5{font-size:2rem;line-height:2rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h5{font-size:1.6rem;line-height:1.6rem}}h6{font-size:1.4rem;line-height:1.4rem}pre{margin:1.6rem 0 1rem 0;padding:1.6rem;overflow-x:auto}code{background-color:#000;color:#fefefe;padding:.4rem .8rem .4rem .8rem}blockquote{border-left:2px solid #dcdcdc;padding-left:1.6rem;font-style:italic}th,td{padding:1.6rem}table{border-collapse:collapse}table td,table th{border:2px solid #000}table tr:first-child th{border-top:0}table tr:last-child td{border-bottom:0}table tr td:first-child,table tr th:first-child{border-left:0}table tr td:last-child,table tr th:last-child{border-right:0}img{max-width:100%}.wrapper{display:flex;flex-direction:column;min-height:100vh;width:100%}.container{margin:0 auto;max-width:120rem;width:100%;padding-left:2rem;padding-right:2rem}.navigation{height:6rem;width:100%}.navigation a{display:inline;font-size:1.6rem;text-transform:uppercase;line-height:6rem;letter-spacing:.1rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.navigation a{font-size:1.4rem}}.navigation ul{list-style:none;margin-bottom:0;margin-top:0}.navigation ul li{float:left;margin:0;position:relative}.navigation ul li a{margin-left:1rem;margin-right:1rem}.content{flex:1;margin-top:1.6rem;margin-bottom:3.2rem}.content article header{margin-top:3.2rem;margin-bottom:3.2rem}.content article header h1,.content article header h2{margin:0}.content article header h2{margin-top:1rem;font-size:1.8rem;color:#323232}@media only screen and (min-device-width:320px) and (max-device-width:480px){.content article header h2{font-size:1.6rem}}.list ul{margin:3.2rem 0 3.2rem 0;list-style:none;padding:0}.list ul li{font-size:1.6rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.list ul li{font-size:1.4rem;margin:1.6rem 0 1.6rem 0}}.list ul li span{display:inline-block;text-align:right;width:20rem;margin-right:3rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.list ul li span{display:block;text-align:left}}.list ul li a{text-transform:uppercase}.pagination{margin-top:6rem;text-align:center}.pagination li{display:inline;text-align:center}.pagination li span{margin:0;text-align:center;width:3.2rem}.pagination li a span{margin:0;text-align:center;width:3.2rem}.centered{display:flex;height:100%;align-items:center;justify-content:center}.centered .about{text-align:center}.centered .about h1{margin-top:2rem;margin-bottom:.5rem}.centered .about h2{margin-top:1rem;margin-bottom:.5rem;font-size:2.4rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.centered .about h2{font-size:2rem}}.centered .about ul{list-style:none;margin:3rem 0 1rem 0;padding:0}.centered .about ul li{display:inline;position:relative}.centered .about ul li a{text-transform:uppercase;margin-left:1rem;margin-right:1rem;font-size:1.6rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.centered .about ul li a{font-size:1.4rem}}.centered .error{text-align:center}.centered .error h1{margin-top:2rem;margin-bottom:.5rem;font-size:4.6rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.centered .error h1{font-size:3.2rem}}.centered .error h2{margin-top:2rem;margin-bottom:3.2rem;font-size:3.2rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.centered .error h2{font-size:2.8rem}}.footer{height:6rem;width:100%;text-align:center;line-height:6rem}.float-right{float:right}.float-left{float:left}
|
*,*:after,*:before{box-sizing:inherit}html{box-sizing:border-box;font-size:62.5%}body{display:flex;color:#323232;background-color:#fefefe;font-family:'Fira Mono',monospace;font-size:1.6em;font-weight:400;letter-spacing:.0625em;line-height:1.8em}@media only screen and (min-device-width:320px) and (max-device-width:480px){body{font-size:1.4em;line-height:1.6em}}a{font-weight:700;color:#000;text-decoration:none}a:focus,a:hover{text-decoration:underline}p{margin:1.6rem 0 1.6rem 0}p a{font-weight:400;color:#000;text-decoration:underline;text-underline-position:under}p a:focus,p a:hover{color:#36c}h1,h2,h3,h4,h5,h6{color:#000;text-transform:uppercase;letter-spacing:.0625em;margin:3.2rem 0 1.6rem 0}h1{font-size:3.2rem;line-height:3.2rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h1{font-size:2.8rem;line-height:2.8rem}}h2{font-size:2.8rem;line-height:2.8rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h2{font-size:2.4rem;line-height:2.4rem}}h3{font-size:2.4rem;line-height:2.4rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h3{font-size:2rem;line-height:2rem}}h4{font-size:2.2rem;line-height:2.2rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h4{font-size:1.8rem;line-height:1.8rem}}h5{font-size:2rem;line-height:2rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){h5{font-size:1.6rem;line-height:1.6rem}}h6{font-size:1.4rem;line-height:1.4rem}pre{margin:1.6rem 0 1rem 0;padding:1.6rem;overflow-x:auto}code{background-color:#000;color:#fefefe;padding:.4rem .8rem .4rem .8rem}blockquote{border-left:2px solid #dcdcdc;padding-left:1.6rem;font-style:italic}th,td{padding:1.6rem}table{border-collapse:collapse}table td,table th{border:2px solid #000}table tr:first-child th{border-top:0}table tr:last-child td{border-bottom:0}table tr td:first-child,table tr th:first-child{border-left:0}table tr td:last-child,table tr th:last-child{border-right:0}img{max-width:100%}.wrapper{display:flex;flex-direction:column;min-height:100vh;width:100%}.container{margin:0 auto;max-width:120rem;width:100%;padding-left:2rem;padding-right:2rem}.navigation{height:6rem;width:100%}.navigation a{display:inline;font-size:1.6rem;text-transform:uppercase;line-height:6rem;letter-spacing:.1rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.navigation a{font-size:1.4rem}}.navigation ul{list-style:none;margin-bottom:0;margin-top:0}.navigation ul li{float:left;margin:0;position:relative}.navigation ul li a{margin-left:1rem;margin-right:1rem}.content{flex:1;margin-top:1.6rem;margin-bottom:3.2rem}.content article header{margin-top:3.2rem;margin-bottom:3.2rem}.content article header h1,.content article header h2{margin:0}.content article header h2{margin-top:1rem;font-size:1.8rem;color:#323232}@media only screen and (min-device-width:320px) and (max-device-width:480px){.content article header h2{font-size:1.6rem}}.list ul{margin:3.2rem 0 3.2rem 0;list-style:none;padding:0}.list ul li{font-size:1.6rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.list ul li{font-size:1.4rem;margin:1.6rem 0 1.6rem 0}}.list ul li span{display:inline-block;text-align:right;width:20rem;margin-right:3rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.list ul li span{display:block;text-align:left}}.list ul li a{text-transform:uppercase}.pagination{margin-top:6rem;text-align:center}.pagination li{display:inline;text-align:center}.pagination li span{margin:0;text-align:center;width:3.2rem}.pagination li a span{margin:0;text-align:center;width:3.2rem}.centered{display:flex;height:100%;align-items:center;justify-content:center}.centered .about{text-align:center}.centered .about h1{margin-top:2rem;margin-bottom:.5rem}.centered .about h2{margin-top:1rem;margin-bottom:.5rem;font-size:2.4rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.centered .about h2{font-size:2rem}}.centered .about ul{list-style:none;margin:3rem 0 1rem 0;padding:0}.centered .about ul li{display:inline-block;position:relative}.centered .about ul li a{text-transform:uppercase;margin-left:1rem;margin-right:1rem;font-size:1.6rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.centered .about ul li a{font-size:1.4rem}}.centered .error{text-align:center}.centered .error h1{margin-top:2rem;margin-bottom:.5rem;font-size:4.6rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.centered .error h1{font-size:3.2rem}}.centered .error h2{margin-top:2rem;margin-bottom:3.2rem;font-size:3.2rem}@media only screen and (min-device-width:320px) and (max-device-width:480px){.centered .error h2{font-size:2.8rem}}.footer{height:6rem;width:100%;text-align:center;line-height:6rem}.float-right{float:right}.float-left{float:left}
|
||||||
|
|||||||
5
static/less/colors.less
Normal file
5
static/less/colors.less
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
@bg-color: #fefefe;
|
||||||
|
@fg-color: #323232;
|
||||||
|
@darker-bg-color: #dcdcdc;
|
||||||
|
@darker-fg-color: #000;
|
||||||
|
@link-color: #3366CC;
|
||||||
41
static/less/style-rtl.less
Normal file
41
static/less/style-rtl.less
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
@import "colors.less";
|
||||||
|
|
||||||
|
body.rtl {
|
||||||
|
direction: rtl;
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
border-right: 2px solid @darker-bg-color;
|
||||||
|
padding-right: 1.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
table tr td:first-child,
|
||||||
|
table tr th:first-child {
|
||||||
|
border-right: 0;
|
||||||
|
}
|
||||||
|
table tr td:last-child,
|
||||||
|
table tr th:last-child {
|
||||||
|
border-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navigation {
|
||||||
|
ul {
|
||||||
|
li {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
ul {
|
||||||
|
li {
|
||||||
|
span {
|
||||||
|
text-align: left;
|
||||||
|
margin-left: 3.0rem;
|
||||||
|
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,4 @@
|
|||||||
@bg-color: #fefefe;
|
@import "colors.less";
|
||||||
@fg-color: #323232;
|
|
||||||
@darker-bg-color: #dcdcdc;
|
|
||||||
@darker-fg-color: #000;
|
|
||||||
@link-color: #3366CC;
|
|
||||||
|
|
||||||
|
|
||||||
*,
|
*,
|
||||||
*:after,
|
*:after,
|
||||||
@@ -154,7 +149,6 @@ table tr th:last-child {
|
|||||||
border-right: 0;
|
border-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
@@ -299,7 +293,7 @@ img {
|
|||||||
margin: 3.0rem 0 1.0rem 0;
|
margin: 3.0rem 0 1.0rem 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
li {
|
li {
|
||||||
display: inline;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
a {
|
a {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
|||||||
Reference in New Issue
Block a user