Skip to content

Commit

Permalink
Reworking on file structure, organizing baseof.html
Browse files Browse the repository at this point in the history
  • Loading branch information
kkeles committed Jan 10, 2024
1 parent 915308a commit 8e315e5
Show file tree
Hide file tree
Showing 30 changed files with 199 additions and 153 deletions.
8 changes: 8 additions & 0 deletions theme.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "themes/awsug"
}
],
"settings": {}
}
4 changes: 2 additions & 2 deletions themes/awsug/LICENSE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
MIT License

Copyright (c) [year] [fullname]
Copyright (c) [2024] [Kadir Keles]

Permission is hereby granted, free of charge, to any person obtaining a copy
Permission is hereby granted, free of charge, to any official AWS User Group obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down
102 changes: 0 additions & 102 deletions themes/awsug/assets/css/about-old.css

This file was deleted.

4 changes: 3 additions & 1 deletion themes/awsug/assets/css/blog.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
border-radius: 10px;
}

.blogSummary {
.blogIntro {
font-family: 'Amazon Ember';
font-weight: 300;
width: 750px;
text-align: justify;
}
6 changes: 3 additions & 3 deletions themes/awsug/content/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+++
title = 'Home'
date = 2023-01-01T08:00:00-07:00
type = "1-home" # folder containing the html file
layout = "home" # name of the html file
draft = false
+++

This is index.md file in the content folder
+++
4 changes: 2 additions & 2 deletions themes/awsug/content/about.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
title = 'About'
date = 2023-11-11T17:25:02+01:00
layout = "about"
type = "custom"
type = "2-about" # folder containing the html file
layout = "about" # name of the html file
+++
2 changes: 2 additions & 0 deletions themes/awsug/content/blog/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
+++
title = 'Blog'
date = 2023-01-01T08:30:00-07:00
type = "5-blog" # folder containing the html file
layout = "blog" # name of the html file
draft = false
+++
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
+++
title = 'Common User Data Templates for EC2'
date = 2023-01-01T09:00:00-07:00
thumbnailURL = ''
blogIntro = 'A powerful detail that will save time in repetitive creation of EC2 instances.'
draft = false
+++

User data is worth considering while launching an EC2 instance. Any type of instance you decide to build, it will be necessary to install some supplementary software (load balancer, content management system, config tools etc.).

A manual, time-consuming method would be to connect to your instance once it’s launched, type in command line one by one, all the software that needs to be installed. User data is an alternative approach, helps you to automatically install all required software with launch of your instance. Especially in repetitive jobs, user data can save you tons of time that is easy to learn and implement.

In order to gain advantage of the user data, simply follow the steps mentioned in How To Launch an EC2 Instance? Article. The only additional step you have to take is:
- At the bottom of the page, click “Advanced details” and in the new area visible;then find user data input at the bottom of the page, to enter your user data script.

![Advanced Details](1.1.png)*Once clicked, User data input field will appear at the bottom of the page*

![User Data Box](1.2.png)


It’s important to understand what input is given to the user data, in order to figure out what software is included and enabled with the launch of the instance.

Probably the most common script for user data will be shared below and we will elaborate the actions taken in the script line by line:

```
#!/bin/bash
yum update -y
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
echo "The EC2 instance is available at $(hostname -f)" > /var/www/html/index.html
```

The first line indicates to the instance to use bash language as the command interpreter. As EC2 evolves and alternative languages are commonly used for development (Python, Ruby, C# etc.) it’s possible to define user data also in different languages. However, for the most common part, bash is a good choice and its declared at the first line.

When the new EC2 instance is launched, there are some various pre-installed packages that are included within. The second line updates these packages to their latest version, in order to make the instance compatible with following software to be downloaded.

Third line installs an Apache HTTP server on your instance. This is also known as httpd server. A common alternative to Apache HTTP server is an Nginx server. For simple projects, it’s suggested to carry on with Apache, while Nginx can be a life saver for complex projects that require high performance.

Fourth and fifth lines are a command to the system, as systemctl gives the hint. While the third line is starting the httpd server that is recently installed, fourth line is making sure that the server is constantly running. This helps to keep your instance up and running as a server, while you are making various adjustments, adding new packages and so on.

Finally on line six, we are generating an index.html file in the corresponding folder. When your EC2 instance is public, to present an interface on world-wide-web, the corresponding /html/ folder in this line is the spot to add your files. Just for a fresh and clean start, the text is added on the index.html file but once you have the page visible as below, you are free to add any html content to make your site public and alive for the whole world!

### Sounds good! But is my EC2 Instance Web-Accessible?
Great question! As you launch your EC2 instance, you will define your firewall settings by selecting the right security group. In order to make your EC2 instance accessible on the web, make sure it has a security group that allows an HTTP access.

Simply see the screenshot below and make sure it has a record of HTTP type, at port 80 with Anywhere (0.0.0.0/0).

![Outbound Rules](2.png)*You need HTTP setting at port 80 in order to make your EC2 instance accessible on the web.*

Once you have your EC2 instance launched, it will take a few seconds to have it’s state as running. However this doesn’t indicate that your EC2 instance is launched with all conditions stated in the user data.

The best way to find this out is to check the instance summary, as in the screenshot below. When the status is pending, you still need to wait for a couple of minutes until all the changes take place.

![EC2 Instance Summary](3.png)*It may take a few minutes for the instance to turn into "Running" state.*

As soon as your instance goes into running state, you can open the Public IPv4 address or the DNS in your browser to visit the page and see it yourself.

With different public IP address provided, you can see the areas marked in green color below.If you have any questions or comment, feel free to share below and enjoy the power of AWS that it brings with!

![EC2 Instance Ready](3.2.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions themes/awsug/content/events/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
+++
title = 'Events'
date = 2023-01-01
type = "4-events" # folder containing the html file
layout = "events" # name of the html file
draft = false
+++
5 changes: 3 additions & 2 deletions themes/awsug/content/team.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
+++
title = 'Team'
date = 2023-11-11T17:25:02+01:00
layout = "team"
type = "custom"
type = "3-team" # folder containing the html file
layout = "team" # name of the html file
+++
meet team
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ <h2 class="eventTitle">{{ .Title }}</h2>
<img class="eventBanner" src="{{ .Params.bannerURL }}" alt="{{ .Title }} Banner" />
</a>
{{ else }}

<a href="{{ .Params.eventURL }}">
<div class="eventBannerContainer">
{{ with .Resources.GetMatch "*.png" }}
<img class="eventBanner" src="{{ .RelPermalink }}" alt="{{ .Title }} Banner" />
{{ end }}
</div>
</a>

{{ end }}
<div class="eventInfo">
<div class="eventInfoIcon">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@

{{ .Content }}
<ul id="blogsGrid">
{{ range .Pages.ByPublishDate }}
{{ range .Pages.ByPublishDate }}
<li class="blogObject">
<a href="{{ .RelPermalink }}"
><h2 class="blogTitle">{{ .LinkTitle }}</h2>
{{ if and .Params.thumbnailURL (strings.HasPrefix .Params.thumbnailURL "https://") }}
<img class="blogBanner" src="{{ .Params.thumbnailURL }}" alt="{{ .Title }} Banner" />
{{ else }} {{ with .Resources.GetMatch "banner.png" }}
<img class="blogBanner" src="{{ .RelPermalink }}" alt="{{ .Title }} Banner" />
<!-- prettier-ignore -->
{{ end }}
{{ end }}
</a>
<p class="blogSummary" >{{ .Summary }}</p>
<p class="blogIntro">{{ .Params.blogIntro }}</p>
</li>
{{end}}
</ul>
Expand Down
26 changes: 11 additions & 15 deletions themes/awsug/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
<!DOCTYPE html>
<html lang="{{ or site.Language.LanguageCode site.Language.Lang }}" dir="{{ or site.Language.LanguageDirection `ltr` }}">
<head>
{{ partial "head.html" . }}
</head>
<body>
<header class="header">
{{ partial "header.html" . }}
</header>
<main>
{{ block "main" . }}{{ end }}
</main>
<footer class="footer">
{{ partial "footer.html" . }}
</footer>
</body>
<html
lang="{{ or site.Language.LanguageCode site.Language.Lang }}"
dir="{{ or site.Language.LanguageDirection `ltr` }}">
<head>
{{ template "_default/head.html" . }}
</head>
<body>
<header class="header">{{ template "_default/header.html" . }}</header>
<main>{{ block "main" . }}{{ end }}</main>
<footer class="footer">{{ template "_default/footer.html" . }}</footer>
</body>
</html>
64 changes: 64 additions & 0 deletions themes/awsug/layouts/_default/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<div class="footer-line"></div>
<div class="footer-column">
<h3><a href="/">HOME</a></h3>
<a href="/">General</a>
<a href="#">Sponsors</a>
<a href="#">Contribute</a>
<a href="#">Feedback</a>
<a href="#">Subscribe</a>
</div>

<div class="footer-column">
<h3><a href="/about/">ABOUT</a></h3>
<a href="/about">AWS</a>
<a href="#">User Groups</a>
<a href="#">Community</a>
</div>

<div class="footer-column">
<h3><a href="/team/">TEAM</a></h3>
<a href="#">Leaders</a>
<a href="#">Members</a>
<a href="#">Volunteer</a>
</div>

<div class="footer-column">
<h3><a href="/events/">EVENTS</a></h3>
<a href="#">Upcoming Events</a>
<a href="#">Past Events</a>
<a href="#">Collaborate</a>
</div>

<div class="footer-column">
<h3><a href="/blog/">BLOG</a></h3>
<a href="#">Categories</a>
<a href="#">Topics</a>
<a href="#">Create</a>
</div>

<div class="footer-right">
<img src="/images/logo.png" />
<p>
This website is run by an independent AWS User Group and it is not affiliated
with Amazon Web Services, Inc.
</p>
<p>
Opinions expressed here are solely those of the authors and do not reflect
official AWS positions.
</p>
<div class="footer-social-items">
<div class="footer-social-item round-icon">
<img src="/images/icons/meetup.png" alt="" />
</div>
<div class="footer-social-item round-icon">
<img src="/images/icons/linkedin.png" alt="" />
</div>
<div class="footer-social-item round-icon">
<img src="/images/icons/twitter.png" alt="" />
</div>
<div class="footer-social-item round-icon">
<img src="/images/icons/email.png" alt="" />
</div>
</div>
</div>
<img src="/images/citygraph.png" class="footer-bg-image" />
5 changes: 5 additions & 0 deletions themes/awsug/layouts/_default/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title> <!-- Title of the site -->
{{ partialCached "head/css.html" . }}
{{ partialCached "head/js.html" . }}
Loading

0 comments on commit 8e315e5

Please sign in to comment.