MEAN JS - where is the main html file (index.html) located - html

I just started learning MEAN JS and I am trying to find the html file for the main page. However I only see home.client.view.html and header.clinet.view.html in the view folder.
From what I know is, usually there is a main html which holds all the information of the home page, and we can add links of CSS files and JS files in the main html file.
How can I add links of extra CSS files and JS files in MEAN JS since i cannot find the main html file?

The MEANJS top level page is located under server/app/views/layout.server.view.html and is where you set header meta tags. Most everthing else on the page is programmatically inserted by angular, such as links to CSS files and Javascript files.
Any of the CSS or Javascripts files under your server/public directly are automagically added to the page. If you wish to add other, third-party scripts or stylesheets, you do so by editing your server configuration file, located at config/env/all.js.
So for example, to add the angular version of the tinymce editor to your MEANJS site, you'd edit config/env/all.js by adding CSS to module.exports.assets.lib.css and references to the tinymce editor and its angular wrapper to module.exports.assets.lib.js.
You will need to restart your server (via the 'grunt' command) if you change this file while the server is running.
UPDATE
Using mean-cli#0.6.1 to scaffold a new mean project, the default "top-level" page is located under packages/custom/meanStarter/public/views/system where you will find two files:
header.html - which describes the layout of the default navbar
index.html - which lays out the content of the default page
Now, having said that, it should be noted that the "proper" way of configuring a mean server to display your own top-level homepage is to create a new mean package.
See the docs for further information.

Related

Jekyll not rendering templated page

I'm running Jekyll 4.0.0 and Bundler version 1.17.2. As this time of posting, it is the latest version of both Jekyll and Bundler.
I have a template called default, which I use to standardize the appearance of navbar, footer, and location of content being displayed.
The directory structure of my website is as follows:
_data: a folder of yml data files for listings of open source projects I worked on
_includes: a folder containing footer and navbar html files
_layouts: a folder containing liquid templated layout files. This is where "default.html" layout file is located.
_posts: a directory of blog posts that I want rendered by Jekyll
CNAME img: image files index.html credits.html
lib: a directory that hosts all of my CSS, fonts, JavaScript files
logo.ico
opensource: a folder containing layouts related to open source
What I'm having trouble with is adding the credits.html page. Using index.html as a template (since index.html renders perfectly), I have the following meta data pasted at the top of credits.html:
---
title: <my name>
layout: default
description: <my description>
---
Under that are all the HTML related to the contents section of the page. When I test my website locally and on github pages, I noticed Jekyll gives me a 404 not found error. I know this is not true because the moment I put credits.html inside another folder (ie: /credits/credits.html) the page renders fine with the url localhost:4000/credits/credits.
I do have permalink set as "pretty" for the entire static website.
Does anyone know why I can't seem to render the credits page? The index page seems to work just fine. I've tried digging through the documentation, but I can't seem to figure out what is affecting that one page.
** EDIT **
I discovered that if I go to localhost:4000/credits/, the page renders perfectly. This is definitely a permalink issue. Can someone point me in the right direction of how I can fix this issue?
I solved the issue!
The reason is because I had permalink enabled in the global configuration file "_config.yml". Inside that file, I had permalink: pretty set. This is why localhost:4000/credits/ worked but not localhost:4000/credits.html.
To resolve this issue, I removed that setting from the global config file. I also realized at the same time that permalink was not necessary for my use case.
For anyone who is in this situation but requires permalink for other sections of your website, set permalink per template file via front matter instead.

How to load different parts of a web-page from different html files

I am making a local website where I have a number of pages with a lot of common code for header, navigation bar and footer.
I was wondering if there was a way I could use to store the header, footer and other such codes as independent html files, and then simply link them in the code for the new page.
You can use server-side includes for using an HTML file into another one. For that, you'll have to make a few changes in your server configuration as well. I'll show you an example of Apache.
Change configuration as mentioned in https://www.linuxtopia.org/HowToGuides/apache_ssi.html
Include the below code in your html file and replace "included.html" with your section html filename
<!--#include file="included.html" -->
Check more on : https://en.wikipedia.org/wiki/Server_Side_Includes

How can I insert / upload an external html file to wordpress?

This may be asked before but I couldn't find any answer which is directly related to my question.
I have a web site using wordpress theme. I want to insert an external html file to the site but I couldn't find anyway to do that.
Note: Just copying the html code doesn't work. The external html file is an R Markdown document created in RStudio. So I must find a way to directly upload it.
You should create a page and paste there your html code
Create a page on the wordpress dashboard (i.e example)
The default appearance of the pages is generated by page.php file located in /wp-contents/themes/YOUR THEME/ folder. Create a php file page-example.php in this folder and paste your html code
When you'll go to this page you'll see the htm code
You have to use Custom Page Template where you can add your own HTML code. After that you just have to choose your page template while creating a page.
Take a look this link to read more about custom page templates.

Single Html Page without CMS (wordpress)

I have a wordpress website (self hosted blog), but now I need to create a page like http://www.example.com/testpage.html.
How can I do this? How this person has done it? http://lukepeerfly.com/demos/iframe/html.txt
there are few ways to a "landing page" in your site. here's 2 methods:
1 - you can create a page in the cms and then make a template for it.
For example, we wanna make a page named "landing". We duplicate the page.php file in our theme and change his name to landing.php (as described here: http://codex.wordpress.org/images/1/18/Template_Hierarchy.png).
Then, in the page's code, in the top, we'll write the template name in the right syntax:
< ?php
/*
Template Name: landing
*/
?>
//other html/php code here
You can include the header, footer, sidebar, or choose not to include them.
the page url will be www.mysite.com/landing.
2 - The second way is to create a file outside your theme folder, in your server's root directory or in some designated folder (using a ftp connection, ofcourse). in the example you brought, http://lukepeerfly.com/demos/iframe/html.txt, html.txt is probably located in root\demos\iframe directory on the server.
your new file will be outside the wordpress. if you do want the file to be a part of your wordpress system (you need it if you want to use wordpress functions, hooks, database and etc) you'll need to include the "wp-load.php" file in the start of your code.
For example, our page, "landing.php", is directory "pages" in my root directory. in the page's code we'll write the following lines:
<?php
require('./../wp-load.php');
?>
//other html/php code here
In here as well, you can include the header, footer, sidebar, or choose not to include them.
the page url will be www.mysite.com/pages/landing.php.
you can just create the .html file and upload it to your FTP server and then link to it in your wordpress blog.

Drupal site. How do I add custom js/css prettify.js/prettify.css for a drupal page?

I want to use custom css/js. I have moved these to the server. But the drupal page starts with a section. how do I add the custom css/js to my drupal site page. I have admin and just need to know what to do to get this included on the page. Please send exact steps as I am totally new to drupal. Thanks
"Custom CSS and JavaScript files" module allows to specify two folders, one for CSS and one for JS where the stylesheets and javascripts files are located respectively.
The module creates two sub-folders under your files folder:
files/customcssjs/css
files/customcssjs/js
Indeed, it's depend on your task, what css and js files should do, and adding these in custom module (drupal_add_js, drupal_add_css) or custom theme (info file, preprocess in template.php or directly in page-XXX.tpl.php and so on).