적당히 숫자넣고 저장한 후 서버에 파일을 올린다.
난, 서버에 부담 갈것 같아서 깃에 블로그 파서 올림
{@
$url = 'https://cdn.jsdelivr.net/gh/OrangeDayCom/orangeday.github.io/releasesNote/version.txt';
//파일 위치
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$last_version = curl_exec($curl);
$http_status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
// 대충 클로링 해서 파일 내용 가져 온다는 내용
if ($http_status_code == 404) :
$last_version = 0;
endif;
// 파일을 못 찾으면 기본 값으로, 난 0
$update = "N";
$current_version = 1.0.1;
if ($current_version < $last_version) $update = "Y";
//기존 버전 하드 코딩하던지 불러 오던지
}
<!--@if($update=='Y')-->
<a href="https://github.com/OrangeDayCom/rhymix-layout" target="_blank">
<em>{$current_version} <i class='bx bxs-right-arrow' ></i> {$last_version}</em>
</a>
<!--@end-->
업데이트 있으면 버튼 생성
-
OrangeDay Master