IGEM WIKI 制作文档

IGEM WIKI

在这里插入图片描述

一、页面以及样式代码的上传

1.1 网页的上传

输入一个曾经没有编辑过的URL
格式为https://2020.igem.org/Team:Team_Name/NewPage
在这里插入图片描述
会进入到一个新界面提示,点击编辑页面
在这里插入图片描述
之后会进入到编辑网页的界面(推荐在自己的编辑器里编辑vscode、webstorm),save page可以保存界面, show
preview可以预览但不保存
在这里插入图片描述
下面是基本的网页结构(和正常的网页结构有所不同)
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

1.2 上传JS/CSS文档

在浏览器中输入一个没有编辑过的Template的URL

格式:

CSS:https://2020.igem.org/Template:Team_Name/CSS/newCSS

JS: https://2020.igem.org/Template:Team_Name/JS/newJS
在这里插入图片描述
点击编辑页面
在这里插入图片描述
之后我们编辑页面是在
在这里插入图片描述

CSS:(直接粘贴CSS文件中的代码即可不用带<style>标签)
在这里插入图片描述
JS(直接粘贴JS文件中的代码即可不用带<script>标签)
在这里插入图片描述
引入头文件方法

JS:
<script src="https://2020.igem.org/wiki/index.php?title=Template:[Team_Name]/JS/[JS_file]&action=raw&ctype=text/javascript"></script>
CSS:
 <link href="https://2020.igem.org/wiki/index.php?title=Template:[Team_Name]/CSS/[CSS_File]&action=raw&ctype=text/css" type="text/css" rel="stylesheet" />
其中team_name 和 JS_FIle/CSS_File 替换为相应的队名 和 JS/CSS URL后缀
例如
<script src="https://2020.igem.org/wiki/index.php?title=Template:BUCT/JS/newJS&action=raw&ctype=text/javascript"></script>
<link href="https://2020.igem.org/wiki/index.php?title=Template:BUCT/CSS/newCSS&action=raw&ctype=text/css" type="text/css" rel="stylesheet" />
1.2 上传模板

模板是IGEM WIKI提供的一种代码复用方法(比如导航栏和页脚复用)
上传方法:
打开一个新的URL,格式:https://2020.igem.org/Template:BUCT/newTamplate
在这里插入图片描述
在html标签中编写网页
在这里插入图片描述
在这里插入图片描述
保存:
在这里插入图片描述
在页面中的引入方法:
把模板的这个部分复制下来(我这里错把模板放在CSS下了,不过不影响,CSS、JS、MODEL只是为了区分页面的种类)
在这里插入图片描述
格式{ {Template:[Team_Name]/MODEL/[newTemplate]}}

要在html标签之前引入
在这里插入图片描述
然后我们就可看到,在引入的界面会出现新的元素:
在这里插入图片描述

二、网页调试:

2.1 IGEM wiki网页的样式冲突:

igem本身会有一个主页框架,打开网页的源代码就可以看到
在这里插入图片描述
本身IGEM会给一些标签定义默认样式,这可能与我们的样式冲突
这就需要我们自定义一些样式:(我将去冲突的样式代码放在导航栏的模板里,因为每个页面都有导航栏,就不必单独去写了)

#sideMenu, #top_title, .patrollink, #firstHeading, #home_logo, #sideMenu {
    display:none; }
#content {
    padding:0px; width:100%; margin-top:-7px; margin-left:0px; border:none;}
body, html {
   background-color:white; width: 100%; height: 100%;}
#bodyContent h1, #bodyContent h2, #bodyContent h3, #bodyContent h4, #bodyContent h5 {
    margin-bottom: 0px; }
#bodyContent a[href ^="https://"], .link-https {
    padding-right:0px;}
#top_menu_inside #bars_item {
   
    position: absolute;
    top: -30px !important;
    left: -100px !important;
    z-index: 100000 !important;
    cursor: pointer;
}
#top_menu_inside #bars_item {
   
    position: absolute;
    top: -30px !important;
    left: -100px !important;
    z-index: 100000 !important;
    cursor: pointer;
}

#sideMenu,
#top_title {
   
    display: none;
}

#content {
   
    padding: 0px;
    width: 100%;
}

body {
   
    background-color: white;
    margin: 0px;
}

#bodyContent h1 {
   
    font-weight: 300 !important;
}

#bodyContent h1,
#bodyContent h2,
#bodyContent h3,
#bodyContent h4,
#bodyContent h5 {
   
    margin-bottom: 0px;
    border-bottom: none;
}

#bodyContent {
   
    padding-right: 0px;
}

#globalWrapper {
   
    font-size: 100%;
    padding: 0px;
    margin: -10px -20px -20px -20px;
}

.navbar-collapse {
   
    padding-left: 0px;
}

#banner {
   
    margin-top: 50px;
}

#sideMenu {
   
    margin-top: 10px;
}

.navbar-nav .dropdown-menu,
.navbar .dropdown-menu {
   
    margin-top: 0;
}

.judges-will-not-evaluate {
   
    width: 96.6%;
    margin: 5px 15px;
    display: block;
    border: 4px solid #3399ff;
    font-weight: bold;
}

.content_wrapper {
   
    width: 100%;
    height: 100vh;
}
2.2IGEM wiki网页的构成

我们只需要关心 id=bodyContent ,以及 id=mw-content-text的DIV标签,我们在edit中编写的代码,是放在 id=mw-content-text的DIV标签中
在这里插入图片描述
在真正的页面中,模板会被替换成相应的代码,同时我们编写的html标签会被去掉

2.3 IGEM wiki网页的调试

推荐本地调试
可以将一个空网页的代码复制到本地,将代码放在 id=mw-content-text的DIV标签中,替换自己的头文件为本地静态文件(连接IGEM WIKI速度很慢)

  • 6
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yzzer

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值