Browse Source

Left/right sidebars in template

Vova Tkach 6 years ago
parent
commit
b81caadb87

+ 19 - 18
README.md

@@ -19,24 +19,25 @@ Usage of ./fave:
 ## Hosts structure
 ## Hosts structure
 ```
 ```
 hosts
 hosts
-├── localhost        # Main host directory
-├──── config         # Config directory
-├────── mysql.json   # MySQL config file
-├──── htdocs         # Public http files
-├──── logs           # Logs dir
-├────── access.log   # Access log file
-├────── error.log    # Error log file
-├──── template       # Engine templates
-├────── 404.html     # Template for 404 page
-├────── footer.html  # Footer
-├────── header.html  # Header
-├────── index.html   # Template for index page
-├────── page.html    # Template for any other pages
-├────── robots.txt   # Host robots.txt file
-├────── scripts.js   # Theme scripts file
-├────── sidebar.html # Can be included in templates
-├────── styles.css   # Theme styles file
-└──── tmp            # Temporary dir for session files
+├── localhost              # Main host directory
+├──── config               # Config directory
+├────── mysql.json         # MySQL config file
+├──── htdocs               # Public http files
+├──── logs                 # Logs dir
+├────── access.log         # Access log file
+├────── error.log          # Error log file
+├──── template             # Engine templates
+├────── 404.html           # Template for 404 page
+├────── footer.html        # Footer
+├────── header.html        # Header
+├────── index.html         # Template for index page
+├────── page.html          # Template for any other pages
+├────── robots.txt         # Host robots.txt file
+├────── scripts.js         # Theme scripts file
+├────── sidebar-left.html  # Can be included in templates
+├────── sidebar-right.html # Can be included in templates
+├────── styles.css         # Theme styles file
+└──── tmp                  # Temporary dir for session files
 ```
 ```
 Unlimited hosts count. Template variables in [Wiki](https://github.com/vladimirok5959/golang-fave/wiki) or [here](https://github.com/vladimirok5959/golang-fave/wiki/Variables-for-template-($.Data)) and [here](https://github.com/vladimirok5959/golang-fave/wiki/Variables-for-template-($.System)).
 Unlimited hosts count. Template variables in [Wiki](https://github.com/vladimirok5959/golang-fave/wiki) or [here](https://github.com/vladimirok5959/golang-fave/wiki/Variables-for-template-($.Data)) and [here](https://github.com/vladimirok5959/golang-fave/wiki/Variables-for-template-($.System)).
 
 

+ 2 - 1
engine/wrapper/wrapper.go

@@ -168,7 +168,8 @@ func (this *Wrapper) RenderFrontEnd(tname string, data interface{}) {
 	tmpl, err := template.ParseFiles(
 	tmpl, err := template.ParseFiles(
 		this.DTemplate+string(os.PathSeparator)+tname+".html",
 		this.DTemplate+string(os.PathSeparator)+tname+".html",
 		this.DTemplate+string(os.PathSeparator)+"header.html",
 		this.DTemplate+string(os.PathSeparator)+"header.html",
-		this.DTemplate+string(os.PathSeparator)+"sidebar.html",
+		this.DTemplate+string(os.PathSeparator)+"sidebar-left.html",
+		this.DTemplate+string(os.PathSeparator)+"sidebar-right.html",
 		this.DTemplate+string(os.PathSeparator)+"footer.html",
 		this.DTemplate+string(os.PathSeparator)+"footer.html",
 	)
 	)
 	if err != nil {
 	if err != nil {

+ 1 - 1
hosts/localhost/template/footer.html

@@ -1,6 +1,6 @@
 						</div>
 						</div>
 						<div class="col-md-4">
 						<div class="col-md-4">
-							{{template "sidebar.html" .}}
+							{{template "sidebar-right.html" .}}
 						</div>
 						</div>
 					</div>
 					</div>
 				</div>
 				</div>

+ 0 - 0
hosts/localhost/template/sidebar-left.html


+ 0 - 0
hosts/localhost/template/sidebar.html → hosts/localhost/template/sidebar-right.html