I am trying to construct a Web site with blogdown, Hugo, and the xmin theme. I would like to store some Markdown files in a subdirectory, say content/misc/, such that they are not going to be treated as blog entries (e.g., they will be pointed to specifically on some _index.md pages).
How can I do this for single files or for all files in a subdirectory of content/? I know I can kind of hide them directly in the content/ directory, however this makes structuring the project clumsy and difficult.
I suspect this will be possible with specific templates, but is there an easier, much simpler way to handle this requirement? Or are there more appropriate themes to make it possible?
If there are some pages that you want to show with a common format, but you do not want them to be listed in your blog articles list
Simple solution: use the default template
To use the default template, you just need to add this "misc" folder in "content" with all your Rmd inside. Then, there will be a page listing all the articles of this type at "myblog.com/misc/".
Advanced solution: use a specific template
If you want to have a specific template for these pages.
If it does not exists, create a "layouts" folder at the root of your project.
Inside "layouts", create a "misc" folder
Inside "misc", create a "list.html" file if you want that your page "myblog.com/misc/" shows a list of your pages with this category
You also need to create a "single.html" if you want a specific way of showing these single articles.
To have ideas what to put inside these two files, you can directly start with the template of your own theme (https://github.com/yihui/hugo-xmin/tree/master/layouts/_default). As I said, you can also look at the "itemized" type of "hugo-future-imperfect" (https://github.com/statnmap/hugo-future-imperfect/tree/master/layouts/itemized), or what I propose for sticky pages on "hugo-statnmap-theme" (https://github.com/statnmap/hugo-statnmap-theme/tree/master/layouts/sticky_pages)
Related
I've been having trouble implementing templates bought in themeforest in a meteor app.
I'm wondering, what would the best way to implement a template into a meteor app.
Two ways that I think of right now are:
(Tedious way)
Place javascript in Compatibility folder and try to name them in specific alphabetic order in order to get them to work properly.
Place css in client/lib folder and try to name them in specific alphabetic order in order to get them to work properly.
Place fonts and images in the public folder.
The second way (I haven't tested it yet) is to place the template files in the public folder and just link them manually (the old/non-meteor way) in the index.html file.
Now I'm not sure if these are the correct ways to do this and I would like some information regarding this issue.
Thanks!
I've done this myself with a themeforest theme.
Put the theme's css file under /client - it doesn't need to be in /public
Use the class names your theme uses in your templates. Typically a theme will have 3x what you really need so this ends up being much less work than it might seem. If your theme is built on bootstrap then it's even easier.
My theme used fontello a lot for icons, I had to recreate the folder hierarchy under client/fonts and then make sure the cross-references were correct.
Typically themeforest themes don't use js that much, I completely ignored all the js that came with my theme and created what I really needed in Meteor.
Hello I am building a new WordPress theme for general open release, eventually I will GitHub it so I want to structure the file names and folders to a good standard so everyone feels comfortable and can find stuff quickly.
I am not referring to the standard files in a WordPress theme such as styless.csss, header.php etc but the files you add and link from functions.php that enhance the functionality as I am looking for a generic framework/standard that exists for a good layout.
Some WordPress themes place files into folders for /lib/ or /inc/ and /assets/ can any one tell me why is this done, what is the structure name?
Ultimately, there is no preset structure to how to organise your Wordpress theme files. Its on how you personally like to keep your themes structured in what you feel comfortable with.
So when people put these structures in place, it is simply to help them figure out where they are in the folder structure and to make it easier to join together files.
Everyone has their own personal way to structuring it, I have my personal opinion on it and I'm sure you will have a way in your head of how you would structure it.
I try not to go too deep into a folder structure with files unless necessary, simply because the Wordpress themes are almost always front end, with Wordpress core dealing with all the back end stuff.
I also like to keep my functions folder modular, in that groups of functions each have their own individual file that can be easily managed and then just need to be included into the functions.php
This is my usual structure:
../
/img/
/js/
../libs/ //used for including large libraries.
/functions/
../nav.php //a single file which has all the function calls for the navigation
/css/
../libs/ //used for css libraries
../sass/ //used for sass files
index.php
style.css
functions.php
.....etc
Then within the functions.php file i will have something like this:
<?php
#include 'functions/nav.php'; // load navigation
#include 'functions/other.php'; // some other file to load
?>
Now this is just how I do it, there is no right or wrong way to do it, everything has their own way and everyone is entitled to do it their own way.
As a project does get bigger or from the outset it is meant to be bigger, then i would recommend really sorting how to structure everything and how everything likes dynamically, simply because it will be easier in the long run.
If you're only working on a small project which wont have large impacts on the admin area or has many options, then keeping it nice and simple will make it easier for yourself.
Hey if want to currently structure your WordPress theme
Then Please Check Underscore A Starter WP Theme.
Link- http://underscores.me/
it is very useful for making good and structured WordPress Theme.
I'm wondering the best way to separate my plugin's templates from the actual logic. Currently I use a series of actions & filters to enable theme authors to alter controls ect from my plugin but it's not very intuitive.
I've heard of template engines like twig but not sure on how big the uptake is on these & whether it might confuse more than it helps.
Does anyone have any experience with this in WordPress?
Thanks
By my experience of plugin development, I have come up with a simple MVC like way separate plugin files. Basically what you can do is use the same folder structure that WordPress core uses. For example, if your plugin name is 'Related Posts' (rp), then the folder structure can be as follows:
wp-content/plugins/root_plugin_folder/rp-admin : This should contain all files which are needed for admin interface of your plugin. Typically the view files for your options page etc.
wp-content/plugins/root_plugin_folder/rp-content : This should contain all plugin's template files. This folder can also store stylesheets, js - basically all that is used within the theme
wp-content/plugins/root_plugin_folder/rp-includes : This is the folder for all model files, includes your plugins core libraries, any other libraries used. Basically pure php code of model or view type.
wp-content/plugins/root_plugin_folder/index.php : This file will be the bootstrap which will have plugin name, description markdown and plugin initiation filters and actions etc.
Hope this helps.
Have you ever used the model-view-controller (MVC) method? Its a method of programming to separate logic from presentation.
Given that I have a URL to a page and I can see the content on it as a user, is there a simple way to find out what template files are producing the page? Ideally I would like to know three things:
The current template file(s) being used
The filename(s) I can create in the local folder to customize them
What variables are available to these file(s)
I just want to know what the general procedure is for finding this information out.
The devel_themer module includes a theme developer function that'll let you click anywhere in the page and determine what templates, theme functions, etc. are used (or can be used) to generate an element.
You can use PHP's get_defined_vars() function to get the variables available in a particular template or function.
I am trying to build an website for my college's magazine. I used the "views" module to show a block of static content I created on the front page.
My question is: how can I edit the theme's css so it changes the way that block of static content is displayed?
For reference, here's the link to the site (in portuguese, and with almost zero content for now).
I can't access your site at the moment, so I'm basing this on fairly limited information. But if the home page is static content, the views module might not be appropriate. It might be better to create a page (In the menu, go to: Create content > page), make a note of the page's url, and then change the default home page to that url (Administer > Site Configuration > Site information, 'Default front page' is at the bottom). Although I might be misunderstanding what you mean by 'static content'.
But however you're creating the front page, don't edit the css in the theme - it'll get overwritten next time you upgrade. Instead you need to create a sub-theme.
As an example, if you want to subtheme Garland, in drupal 6. You first need to setup a directory for your themes. Go to sites/all/ in your drupal installation, and create a subdirectory called themes if it doesn't already exist. Go into that directory, and create a directory for your subtheme, say mytheme (i.e. sites/all/themes/mytheme/). Then use your text editor to create a file called mytheme.info in that directory, with the contents:
name = My Theme
version = 0.1
core = 6.x
base theme = garland
stylesheets[all][] = mytheme.css
And then use your text editor to create a file called mytheme.css in that directory, and put the extra CSS in there.
For more information, there's the druapl documentation on .info files and style sheets. Although, you might want to buy a book, as the online documentation isn't great.
The main css file that drives your content is the styles.css file located in your currently selected theme. In your case that means that most of your site styling is driven by this file: /aroda/roda/themes/garland/style.css with basic coloring effects handled by this file:
/aroda/roda/files/color/garland-d3985506/style.css
You're currently using Garland, the default Drupal theme included with the core download, so for best practices you shouldn't edit the included style.css file directly. Instead, you should, as Daniel James said, create a subdirectory in /sites/all called "themes".
If you're using Drupal 6, I'd follow Daniel James directions from there. If you're using Drupal 5, I'd go ahead and copy the garland directory into the themes directory and rename it for something specific to your site (aroda_v1) so you would have something like /sites/all/themes/aroda_v1 which would contain styles.css. At that point, you can edit the styles.css file directly to make any changes you see fit. Hope that helps!
It looks like most of your CSS info is in some *.css files. There is also some inline Style info on the page. Your style for the static info comes from the in-line stuff. I am not sure how Drupal generates the page but the place to start looking is for any properties for "ultima-edicao". That is what the surrounding DIV is called.