gh pages Pretty Permalinks with .nojekyll - github-pages

We are uploading a pre built static site to gh pages using the .nojekyll file in the root folder. However if we use pretty URLs without the .html extension then all of our links present the user with a file open/save as dialog because the browser thinks it's file octet stream.
As we are not using Jekyll do we need to have a _config.yml ? Either way with or without cant get pretty urls to work.

Related

Syncing code on static site between multiple html pages?

I have a large website with several consistent text, like the nav, contact, footer, etc. I was wondering how I could keep all of these consistent on my static website (hosted on github pages) by loading the code from another file or any other method, since currently I have to manually update everything and it takes a while.
Github pages uses Jekyll as the underlying static site generator. You can break down your site into multiple smaller html pages that can be included into a main layout.
https://jekyllrb.com/docs/includes/
The include tag allows you to include the content from another file
stored in the _includes folder:
{% include footer.html %}
Jekyll will look for the referenced file (in this case, footer.html)
in the _includes directory at the root of your source directory and
insert its contents.
Read the documentation on this and you can easily find repeated text/html and replace them with includes.
If you're not already, this site has instructions so you can run jekyll locally to verify changes before pushing the changes to Github.

Coldfusion: What are security issues that can occur if I allow users to upload .css and .js files to my site

I want users to upload their themes containing .css, .js files to my server in zip format, Once they will upload the application will unzip it and the user will be able to see the theme at mysite.com/themes/user/. I want to know what security issues can occur if I allow user to upload .css and js files to my server. Can the malicious code redirect the site or do DOS service attack or change the dynamic aspects on my site. Scanning the files for malicious code before unzipping seems impractical. What safeguards should I take.
First and foremost, don't unzip them into a public "temp" folder while you're doing whatever else you're going to do with them.
There's no telling what that ZIP file will actually contain.
There's no telling what those JS files will try to do to your site.
You should read what Samy did to MySpace before you implement this functionality. (A breakdown of the attack.)

Github Pages 404 for everything but index.html

I have a Github pages website for our team at http://olinaeromarketing.github.io/. I've tried opening index.html locally and it works perfectly in chrome on my pc. Everything loads perfect. However, when I push everything to Github and try to open it with http://olinaeromarketing.github.io/, everything except index.html gives a 404 error and can't load. I'm pretty stumped as to why this is happening. I also haven't been able to find anything on the web regarding this issue.
The repository is located at https://github.com/OlinAeroMarketing/OlinAeroMarketing.github.io. BTW, the website is currently a WIP and not yet finished.
By default, Jekyll is used to process GitHub Pages. Files/directories that begin with an underscore have special meaning for Jekyll and are, therefore, treated differently.
Since you don't seem to be using Jekyll, your simplest solution is to add a file named '.nojekyll' to the root path to disable Jekyll functionality.
Check out https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/ for more info.
Edit: Just to be clear, the offending directory is '_include'.

Using fossil embedded documents

I'm using fossil to manage some home projects and keeping notes in the wiki. After running like this for a few months, I'd like to at least try to use embedded documentation; mainly so as to be able easily to go back to previous versions.
I've studied the website page about managing project documentation which confirms that this is a technique I want to follow up, but I can't make out how to do it.
I've cut-and-pasted one of my wiki pages and added it to my fossil repo, but I can't work out where it should go in the directory structure to be accessible as described on the above page.
I've tried in a few places none of which worked. The document is currently %fossil-root%\doc\foo.wiki, (I'm on Windows), where %fossil-root% is the directory holding _ _FOSSIL__ (slighly mangled filename because of markdown), but having started a server with fossil ui, when I point my browser at http://localhost:8080/doc/foo.wiki, fossil presents me with a nicely formatted page saying it can't find index.html. I created /doc/index.html to see what would happen, but it made no difference.
Please can someone help me out, and/or point me to an example repository containing embedded documentation or another "how-to" document.
If your document is located in %fossil-root%\doc\foo.wiki, you can access it at the following URL:
http://localhost:8080/doc/trunk/doc/foo.wiki
This URL breaks down as follows:
http://localhost:8080 is the root URL to access Fossil when you run fossil ui
/doc signals that you want to access embedded documentation
/trunk indicates the checkin containing the documentation you wish to access
/doc/foo.wiki is the path of the document inside the repository
Instead of trunk, you can also specify a tag, or a branch name, or even a hexadecimal checkin identifier.
In the URL you were using, http://localhost:8080/doc/foo.wiki, foo.wiki is interpreted as the checkin name, and no document path is specified, which logically means Fossil won't find anything.
As for an example repository containing embedded documentation, the homepage of the Fossil website itself is a prime example:
https://www.fossil-scm.org/index.html/doc/trunk/www/index.wiki
where
https://www.fossil-scm.org/index.html is Fossil's root URL
/doc indicates a request for embedded documentation
/trunk indicates we want to fetch files from the trunk
/www/ is the path to the requested file inside the repository
index.wiki is the name of the file inside the repository.
So, in the 'trunk' branch of the repository, the file www/index.wiki contains the home page of the Fossil website.
You simply need to put the documentation under the %fossil-root%\www\ directory (or any other directory under version control) in your repository and then you can, for example, add the following line to your header's mainmenu section to link to it:
html "<a href='$home/doc/trunk/www/foo.wiki'>Documentation</a>\n"
As I said, it can be any directory under version control. To test this, pick any file in the repository, let's say a README file at the top level, and go to http://localhost:8080/doc/trunk/README. You should see the README file load up in your browser in a raw text format. By putting wiki or html files under a particular directory such as www you make it easy to organize the files that you specifically want rendered as documentation, which makes it easier to link to them.
http://www.fossil-scm.org/index.html/doc/trunk/www/embeddeddoc.wiki
After fossil 1.33, just prepare your document in the repository.
If the wiki file is put in
/doc/index.wiki
And use web browser to setup -> Admin -> Configuration.
There is a "Index Page" field, fill in your main index.html.
For example:
/doc/trunk/doc/index.wiki
Or if you just want the released version:
/doc/<version>/doc/index.wiki

Locate the file path on a Joomla website PHP

I need to know in which folder is located the address of my joomla site. In the address bar it shows http://www.gybr.com.br/index.php/videos , so where is this page??
The videos page would not be located in any particular folder, but is built from a record in the database. You should be able to go to the root of your website hosting files and see the index.php file there, but you won't find any of the pages in the folders, because they don't exist as files. Each are referenced in the database and built accordingly. Joomla then uses a routing class to parse that url and connect it to the appropriate database record.
You would need to log in to the administration side of Joomla and see what menu item type the videos page has to determine what component generates the page. This could help you find the correct file if you are trying to change something, but in the end, it will have little relation to the path you are seeing in the url.
To find out the folder, adding the following PHP code to somewhere in your site should do the trick (index.php is probably your best bet):
<?php
if (defined('JPATH_BASE')) {
echo JPATH_BASE;
}
else {
echo getcwd();
}
?>