diff --git a/Makefile b/Makefile index 4b501ba..fd508ba 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,29 @@ +# LESS params LESS_DIR = ./static/less LESS_FILE = style.less +LESS_RTL_FILE = style-rtl.less + +# CSS params CSS_DIR = ./static/css CSS_FILE = style.min.css +CSS_RTL_FILE = style-rtl.min.css CSS_TMP_FILE = tmp.css -.PHONY: clean demo build - -build: clean - lessc $(LESS_DIR)/$(LESS_FILE) > $(CSS_DIR)/$(CSS_TMP_FILE) - uglifycss $(CSS_DIR)/$(CSS_TMP_FILE) > $(CSS_DIR)/$(CSS_FILE) +define build_less + lessc $(LESS_DIR)/$(1) > $(CSS_DIR)/$(CSS_TMP_FILE) + uglifycss $(CSS_DIR)/$(CSS_TMP_FILE) > $(CSS_DIR)/$(2) 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 mkdir -p demo/themes/coder diff --git a/README.md b/README.md index 9f705f9..9b282cc 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,10 @@ pygmentscodefencesguesssyntax = true # Enable syntax guessing for code fences wi hideCopyright = false # Custom CSS - custom_css = [] + custom_css = [] + + # RTL support + rtl = false # Social links [[params.social]] diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 3dc070e..d7fda4b 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -24,7 +24,10 @@ disqusShortname = "yourdiscussshortname" hideCopyright = false # Custom CSS - custom_css = [] + custom_css = [] + + # RTL support + rtl = false [[params.social]] name = "Github" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 057fb01..6a16466 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -18,6 +18,10 @@ + {{ if .Site.Params.rtl}} + + {{ end }} + {{ range .Site.Params.custom_css }} {{ end }} @@ -33,7 +37,7 @@ {{ .Hugo.Generator }} - +
{{ partial "header.html" . }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 71af496..1ec4fbf 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -4,7 +4,7 @@ {{ .Site.Title }} {{ with .Site.Menus.main }} -