Skip to content

Commit

Permalink
Add template for website
Browse files Browse the repository at this point in the history
  • Loading branch information
manutheblacker authored Nov 18, 2023
1 parent f6fb515 commit d4e9fe9
Show file tree
Hide file tree
Showing 14 changed files with 2,217 additions and 1 deletion.
33 changes: 33 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: default
---
<!--header-->
<header class="main-header clearfix" role="header">
<div class="logo">
<a href="https://{{ site.targeturl }}"><em>{{ site.targeturl }}</em></a>
</div>
</header>

<!-- ***** Main Banner Area Start ***** -->
<section class="section main-banner" id="top" data-section="section1">
<video autoplay muted loop id="bg-video">
<source src="assets/images/course-video.mp4" type="video/mp4" />
</video>

<div class="video-overlay header-text">
<div class="caption">
<h6>Redirect domain from {{ site.url }} to</h6>
<h2><em>{{ site.targeturl }}</h2>
<div class="main-button">
<div class="scroll-to-section"><a href="https://{{ site.targeturl }}" id="conti">Continue</a></div>
</div>
</div>
</div>
</section>
<script>
var url = document.URL;
var url = url.replace("{{ site.url }}/{{ site.baseurl }}", "{{ site.targeturl }}");

document.getElementById("conti").href = url;
</script>

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 HUST & PI

Permission is hereby granted, free of charge, to any person 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
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## What is this project? ![](https://img.shields.io/badge/license-MIT-green)

If you have a domain [https://www.tailieubkhn.com/2021/10/website-hoc-machine.html](https://www.tailieubkhn.com/2021/10/website-hoc-machine.html), so you want share it to facebook or twitter, that you want avoid facebook or twitter block your domain, this is solution you need. This project help convert your domain to github domain, Because it is the domain of github, it has a certain reputation

## Demo:

[https://piandhust.github.io/tailieubkhn/convert](https://piandhust.github.io/tailieubkhn/convert), and paste domain you want convert from website tailieubkhn to github pages, domain [https://www.tailieubkhn.com/123](https://www.tailieubkhn.com/2021/10/website-hoc-machine.html) will convert to [https://piandhust.github.io/tailieubkhn/123](https://piandhust.github.io/tailieubkhn/2021/10/website-hoc-machine.html), And when you access to link github page you will see a website have a button _Continue_, click to button _Continue_ website will redirect to [https://www.tailieubkhn.com/](https://www.tailieubkhn.com/):

| ![](https://raw.githubusercontent.com/piandhust/tailieubkhn/master/images/convert.png) |
| :----: |
| Convert website |

| ![](https://raw.githubusercontent.com/piandhust/tailieubkhn/master/images/home.png) |
| :----: |
| Website redirect |


## Configuration

Edit file `_config.yml`:
```yml
permalink: /404.html
url: "piandhust.github.io"
targeturl: "tailieubkhn.com"
baseurl: "tailieubkhn"
```
With:
- `url` is url of your github page website, if your username is trannguyenhan, this is trannguyenhan.github.io
- `targeturl` is url of target website you want convert domain from github page to it
- `baseurl` is name of this repo

**Note**: because domain `/convert` has been taken to make a website to convert, so your domain will ignore `/convert`.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
permalink: /404.html
url: "piandhust.github.io"
targeturl: "tailieubkhn.com"
baseurl: "tailieubkhn"
44 changes: 44 additions & 0 deletions _layouts/convert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<html>
<head>
<title>Convert domain</title>
<style>
/* #sidebarrightnbt{
display: none;
}

#mainblogsec{
width:150%;
}
#comments{display:none;}
footer{display:none;}
.home-link{display:none;}
#nav-searchnbt{display:none;} */
input[type=text] {
width: 80%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
}
.button {
width: 15%;
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
label {
color: #B4886B;
font-weight: bold;
float: left;
}
label:after { content: ": " }
</style>
</head>
<body>
{{ content }}
</body>
</html>
26 changes: 26 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link href="https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900" rel="stylesheet">

<title>tailieubkhn.com</title>

<!-- Bootstrap core CSS -->
<link href="/{{ site.baseurl }}/css/bootstrap/bootstrap.min.css" rel="stylesheet">

<!-- Additional CSS Files -->
<link rel="stylesheet" href="/{{ site.baseurl }}/css/templatemo-grad-school.css">
<link rel="stylesheet" href="/{{ site.baseurl }}/css/owl.css">
<link rel="stylesheet" href="/{{ site.baseurl }}/css/lightbox.css">
</head>

<body>
{{ content }}
</body>
</html>
39 changes: 39 additions & 0 deletions convert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: convert
---
<script>
function convert () {
var url = document.getElementById("input_text");
url = url.value;
if(url == ""){
alert("Bạn cần nhập vào URL !");
} else {
if(!url.includes("www")){
url = url.replace("{{ site.targeturl }}", "{{ site.url }}/{{ site.baseurl }}");
} else {
url = url.replace("www.{{ site.targeturl }}", "{{ site.url }}/{{ site.baseurl }}");
}

document.getElementById("output_text").value = url;
}
}

function copyURL() {
var copyText = document.getElementById("output_text");
copyText.select();
copyText.setSelectionRange(0, 99999)
document.execCommand("copy");
alert("Copied the text: " + copyText.value);
}
</script>
<div style="font-family: Courier New; margin: 0px auto; width: 80%;">
<label>URL of page {{ site.targeturl }} </label><br />
<input id="input_text" type="text" />
<button class="button" onclick="convert()">Convert</button>
<br />
<br />
<br />
<label>URL of github page:</label><br />
<input id="output_text" readonly="readonly" type="text" />
<button class="button" onclick="copyURL()">Copy</button>
</div>
7 changes: 7 additions & 0 deletions css/bootstrap/bootstrap.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit d4e9fe9

Please sign in to comment.